Yum in Fedora Core 3

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
This entry was posted in Linux, Tips. Bookmark the permalink. Both comments and trackbacks are currently closed.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

21 Comments

  1. Posted November 28, 2004 at 3:59 am | Permalink

    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.

  2. Posted December 20, 2004 at 2:52 pm | Permalink

    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.

  3. NoBoDy
    Posted January 20, 2005 at 6:52 am | Permalink

    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 :)

  4. BigCheeze
    Posted January 20, 2005 at 7:30 pm | Permalink

    Nicely done. Couldn’t ask for easier instructions. Thanks!

  5. ElPrez
    Posted January 21, 2005 at 3:27 pm | Permalink

    Thank you for a very helpful tutorial – really hit the nail on the head for me :)

    Ta muchly.

  6. altius
    Posted January 24, 2005 at 5:35 pm | Permalink

    This is an amazing how-to-torial. Thanks a billion.

  7. nick malnati
    Posted March 7, 2005 at 12:36 pm | Permalink

    amazing… your site was #1 for this search. Small world…even on the web, Oliver!

  8. nick beam
    Posted March 12, 2005 at 3:45 am | Permalink

    great tutorial, just what I was looking for!

  9. lee
    Posted March 16, 2005 at 6:50 pm | Permalink

    fantastic!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    everything and more
    thank you very much

  10. Matt
    Posted April 4, 2005 at 10:33 am | Permalink

    Thanks, there’s way too fuch FC2 info out there!

  11. gaurav
    Posted April 28, 2005 at 3:29 am | Permalink

    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.

  12. Matthew
    Posted May 3, 2005 at 10:35 am | Permalink

    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

  13. Ulises Erickson
    Posted May 21, 2005 at 8:07 am | Permalink

    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.

  14. Anonymous
    Posted June 25, 2005 at 11:55 am | Permalink

    I upgraded from fc2 to fc4, now yum still looks for fc2 as releasever. How do I change that?

  15. Posted July 27, 2005 at 7:51 am | Permalink

    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!

  16. John
    Posted September 26, 2005 at 6:43 am | Permalink

    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…

  17. Posted November 24, 2005 at 2:17 pm | Permalink

    Thanks brother :)
    This blog very userful for me :d

  18. Ghiro
    Posted December 17, 2005 at 11:31 pm | Permalink

    that saved a lot of time trying…. really appriciated :)

  19. Plutoxi
    Posted December 19, 2005 at 6:56 pm | Permalink

    thx a lot !

    Cannot find a valid baseurl for repo: updates-released :’(
    help? :)

  20. Plutoxi
    Posted December 19, 2005 at 6:59 pm | Permalink

    sorry it’s me thx a lot :) :) :)

  21. Brian
    Posted January 15, 2006 at 2:30 pm | Permalink

    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.

  • Archives