Yum, short for Yellow Dog Updater, Modified, is a package manager for RPM-compatible Linux systems.Yum is the standard tool for updating Fedora Core, and up2date can use yum repositories to update software. Its main advantages over the RPM version of apt are its smaller codebase and better dependency handling.
To begin using Yum to its full potential with a clean install of FC3, we must first import the Fedora GNU Privacy Guard (GPG) key. For additional security, all software packages distributed as part of the The Fedora Project are signed with the fedora@redhat.com public key. If we attempt a yum update at this point, we’ll see the following:
[root@beta ~]$ yum update
Password:
You have enabled checking of packages via GPG keys. This is a good thing.
However, you do not have any GPG public keys installed. You need to download
the keys for packages you wish to install and install them.
You can do that by running the command:
rpm --import public.gpg.key
For more information contact your distribution or package provider.
The Fedora GPG key has been installed on your system during the initial installation, so importing the key is a simple process:
[root@beta ~]$ rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
Now the yum update command will complete successfully.
To fully utilize the potential of yum, we need to know how to add third-party repositories that may offer customized packages not available directly from the Fedora Project. In FC3, the default configuration ([main] section) is located in /etc/yum.conf, and all repository information is stored in /etc/yum.repos.d/ as .repo files. By default, yum uses the following mirrors:
[root@beta ~]$ cat /etc/yum.repos.d/fedora.repo [base] name=Fedora Core $releasever - $basearch - Base #baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/ mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever enabled=1 gpgcheck=1 [root@beta ~]$ cat /etc/yum.repos.d/fedora-updates.repo [updates-released] name=Fedora Core $releasever - $basearch - Released Updates #baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/ mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever enabled=1 gpgcheck=1
These configuration files can (and should!) be modified to contain geographically local Fedora Project mirrors. Take a look at the mirrors for base packages and updates and select the fastest and/or closest mirrors. Place these URLs into text files on your computer like so (note: these are my ideal mirrors, yours will be different):
[root@beta ~]$ cat /etc/yum.repos.d/local-base # My local FC mirrors http://ftp.ndlug.nd.edu/pub/fedora/linux/core/3/$ARCH/os/ http://fedora.gtlib.cc.gatech.edu/pub/fedora.redhat/linux/core/3/$ARCH/os http://ftp.ussg.iu.edu/linux/fedora/linux/core/3/$ARCH/os/ [root@beta ~]$ cat /etc/yum.repos.d/local-updates # My local FC update mirrors http://ftp.ndlug.nd.edu/pub/fedora/linux/core/updates/3/$ARCH/ http://fedora.gtlib.cc.gatech.edu/pub/fedora.redhat/linux/core/updates/3/$ARCH/ http://ftp.ussg.iu.edu/linux/fedora/linux/core/updates/3/$ARCH/
Now we need to update the default fedora.repo and fedora-updates.repo to point to your custom mirror list, like so:
[root@beta ~]$ cat /etc/yum.repos.d/fedora.repo [base] name=Fedora Core $releasever - $basearch - Base #baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/ #mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever mirrorlist=file:///etc/yum.repos.d/local-base enabled=1 gpgcheck=1 [root@beta ~]$ cat /etc/yum.repos.d/fedora-updates.repo [updates-released] name=Fedora Core $releasever - $basearch - Released Updates #baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/ #mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever mirrorlist=file:///etc/yum.repos.d/local-updates enabled=1 gpgcheck=1
Your machine will now use your local mirrors instead of the default mirror list.
Where yum really shines in the ease with which you can incorporate third-party repositories. Adding a new repository is as simple as adding new .repo files. Here are configuraton files for a few common repositories.
Fedora Development:
[root@beta ~]$ cat /etc/yum.repos.d/fedora-devel.repo [development] name=Fedora Core $releasever - Development Tree #baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/development/$basearch/ mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-rawhide enabled=1 gpgcheck=1
FreshRPMs.net:
[root@beta ~]$ cat /etc/yum.repos.d/freshrpms.repo [core] name=FreshRPMS-Core baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/core enabled=1 #gpgcheck=1 #[extras] #name=Fedora Linux $releasever - $basearch - extras #baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/extras #enabled=0 #gpgcheck=1 #[alternatives] #name=Fedora Linux $releasever - $basearch - alternatives #baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/alternatives #enabled=0 #gpgcheck=1 [updates] name=FreshRPMS-Updates baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/updates enabled=1 #gpgcheck=1 [freshrpms] name=FreshRPMS-Fresh baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms enabled=1 #gpgcheck=1
Livna.org:
[root@beta ~]$ cat /etc/yum.repos.d/livna.repo [livna] name=Livna Stable baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/RPMS.stable/ enabled=1 #gpgcheck=1
Dag:
[root@beta ~]$ cat /etc/yum.repos.d/dag.repo [dag] name=Dag baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag/ enabled=1 #gpgcheck=1
21 Comments
Sweet! I just upgraded my box from redhat 9 to FC3 with yum. This helped a lot. I’ve been using apt and was having some problems upgrading, decided to switch over to yum and your tutorial rocked!
I just had to change the $releasever and $basearch into the actual numbers, other than that, it was beautiful. I even ate some cheese in celebration.
Thanks.
Thanks Oliver! I’ve been scouring over several articles on how to configure yum to update my fresh install (torrent’d the ISO’s) and keep it current nightly, without depending on the overly hammered Redhat servers. This worked perfectly.
Hey that was very useful information .. never got such a crystal clear ..
i tried many sites but no luck .. thx to u i am able to have my pc updated..
Thanks again
Nicely done. Couldn’t ask for easier instructions. Thanks!
Thank you for a very helpful tutorial – really hit the nail on the head for me
Ta muchly.
This is an amazing how-to-torial. Thanks a billion.
amazing… your site was #1 for this search. Small world…even on the web, Oliver!
great tutorial, just what I was looking for!
fantastic!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
everything and more
thank you very much
Thanks, there’s way too fuch FC2 info out there!
Hello all,
Can any body here help me create YUM repos. on Fedora Core 3, I need it badly plz help me out, i would rellay appriciate your help………………………………………… waiting for your responce.
Hi Gaurav,
This URL is the best explanation I have found for the new createrepo (beware of how to’s that use yum-arch it is deprecated)
http://www.hn2.org/wiki/index.php/Building_a_FC3_YUM_Update_Server
this one is more detailed and includes a script that will use yum-arch and/or createrepo depending on what you have installed:
http://fedoranews.org/alex/tutorial/yum/index.shtml
Hi this article help me a lop, because i was tring to install some lost rpm, and whit a couple of simple commands i manage to complete my mision, sorry my english. it is not my natural languaje.
Ademas quiero agradecerles en nombre de todos los usuarios que quieren aprender y no encuntran solucion a sus problemas, este articulo me ha ayudado no solo a resolver mi problema, tambien me dio una noción más clara de yum y como puedo usarlo en linux, gracias de Cora.
I upgraded from fc2 to fc4, now yum still looks for fc2 as releasever. How do I change that?
Hey!
This blog has been the most helpfully compare to others i can across i have been having problems updating my box and installing stuff but now everything work 100%
baie dankie!
Thanks for the information, mate!
This is the only web site on the whole internet that has a well written guide about yum configuration…
Such a same that it doesn’t come up the first place on Google…
Thanks brother
This blog very userful for me :d
that saved a lot of time trying…. really appriciated
thx a lot !
Cannot find a valid baseurl for repo: updates-released :’(
help?
sorry it’s me thx a lot
Awesome. I am left with only two questions. 1) How does YUM determine in which sequence to access the .repo files and does it matter? 2) How important is failoverpriority? I did not see it mentioned in your HOW-TO. Thanx again. When explained simply YUM is real easy to understand and use.