You are here

howto: local media repo

recently, i had to install some software from the install media coz the machine i was on had no access to the internet. after one attempt at trying to find all the dependencies and installing all the packages via rpm, i dediced to find out how to use the install repo after install.

what i came up with was this:

[dvd]
name=Install DVD : Version $releasever - $basearch
baseurl=file:///media/
enabled=1
gpgkey=file:///media/RPM-GPG-KEY-fedora
gpgcheck=1

so then i decided to implement it on my personal boxes and discovered that solution wasnt very nice. if the install media isnt in the tray, yum will fail. yum upgrade will fail. yum install will fail. so on to #fedora on irc://irc.freenode.net to ask around. while jroysdon helped me out a bit, it too wasnt the perfect solution: keeping

enabled=0 

and doing a

yum -y install --enable-repo=dvd <packagename>

in the end, the final solution was really quite simple. its in /etc/yum.repos.d/fedora.repo

[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
baseurl=file:///media/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
priority=0

if you noticed, what i had done was added another line for baseurl

of course this solution only works if you mount the media (or iso) on to /media like i do. if its somewhere else change the baseurl appropriately. pls. note that if your path has blanks in it as in "/media/Fedora 12" you have to take appropriate action to escape the special characters (eg %20 for blanks)

enjoy