[ Prev ] [ Index ] [ Next ]

Yellow Dog Update Manager

Created Monday 13/2/2006

This document describes yum(1), the Yellow Dog Update Manager, which is the defacto remote package management system in Fedora Core. Whilst other package management systems such as apt(1) can be used instead of yum to maintain Fedora, it is probably easier to stick with yum given that each release and update of Fedora comes with the yum repository files. This document is not a comparision of remote package management systems and makes no recommendations as to which is better

The yum configuration is typically split into 2 sections, a configuration file /etc/yum.conf that specifies global options and a directory /etc/yum.repos.d that contains individual repository information files, which specify which repositories are active and where they can be found on the net. Each repository file may chooise to override the global configuration settings in /etc/yum.conf. In addition, repository entries can be placed in the global /etc/yum.conf, although this is not recommended. The YUM project site maintainer is Linux Duke.

1. Installing yum from rpm

This step is not needed for newer FC installs, as yum comes installed with the operating system. However, for some older redhat distros, yum can be installed via rpm(1) from linux.duke.edu, which is the yum maintainer. Grab the yum rpm or source tarball of choice, using a preferred download method. For example, to get the yum 3.0.3 tarball via wget(1):

bash $ wget http://linux.duke.edu/projects/yum/download/3.0/yum-3.0.3.tar.gz  

2. Adding a new repo

Yum keeps it's repository entries in /etc/yum.repos.d, typically in separate files for each repository. Whilst this is not strictly necessary, it's probably the best way to go. Yum repo entries can be added manually by adding a new file or editing an existing one and adding an entry in windows "ini" format. The other option is to use rpm(1) to create the repo file entry, like the following which creates a new file for freshrpms:

bash # rpm -ihv http://ayo.freshrpms.net/fedora/linux/6/i386/RPMS.freshrpms/freshrpms-release-1.1-1.fc.noarch.rpm

3. Adding 3rd party packages

The base yum install comes with the fedora core packages and fedora extras but there are several other package maintainers of interest. For examaple, the livna packages contain 3D drivers for ati and nvidia and also contain packages for mp3 support (which is disabled by default in the base FC install for licensing reasons).

3A. Livna

The livna package is useful for mp3 support and for drivers for 3D cards. Modify yum.repos.d to add livna in a separate file, called for example livna.repo, with the following content (or use the rpm(1) install as shown in #2 above):

[livna-stable]
name=Livna.org Fedora Compatible Packages (stable)
baseurl=http://rpm.livna.org/redhat/$releasever/$basearch/yum/stable
[livna-unstable]
name=Livna.org Fedora Compatible Packages (unstable)
baseurl=http://rpm.livna.org/redhat/$releasever/$basearch/yum/unstable
[livna-testing]
name=Livna.org Fedora Compatible Packages (testing)
baseurl=http://rpm.livna.org/redhat/$releasever/$basearch/yum/testing

Note, that rpm(1) can be used to install a yum repository, which, is the rpm is available, is probably the better option (see #2, above).

4. Adding GPG keys

If gpg support is enabled for a repo, then the repo must tell yum where the key can be found. Yum will then import the key on demand. The other option is to directly import any keys that might be required. In the following example, the livna gpg key is installed into the rpm database:

bash # rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY

5. Repository updates

The yum packages should be periodically updated. This will download the new versions of installed packages and removed those that are redundant or are nolonger required. The "update" command is issued with

bash # yum update

6. Installing xmms mpeg layers 1/2/3 (libmpg123.so)

Due to licensing and copyright issues fedora does not come with mp3 nor mp4 (mpeg) support in xmms. This can easily be added by installing the xmms-mp3, lame and faad and sox pages. For xmms mp3/mp4 support, install xmms-mp3 as follows:

bash # yum install xmms-mp3

7. Specifying repositories in yum

Yum repository configuration can be either completely encapsulated in /etc/yum.conf in win32-style sections (this is not recommended) or can be added in separate repository files in /etc/yum.repos.d, which this is the preferred approach to repository configuration and will be the option discussed here.

Typically yum repository files havea a .repo extension and hold the different environments for a repositories, such as stable, testing, development, debug and source. There are usually several such repository files, with fedora-core.repo, fedora-extras.repo and fedora-updates.repo being the minimum. Repository configuration for fedora core will be covered here.

Each repo file contains sections, in win32-inifile format. The section name is simply an arbitrary section identifier, such as [fedora-core]. The following excerpt of a yum repository file shows 3 sections for the Fedora Core repository for stable (the [fedora] section), debug (the [fedora-debuginfo] section) and source (the [fedora-source] section).

[fedora]
name=Fedora $releasever - $basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[fedora-source]
name=Fedora $releasever - Source
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

In the previous excerpt, each section has 5 elements, which are ▢ name —▶ The name of the repository. Displayed when metadata or other info are requested for the repo ▢ mirrorlist —▶ The url of a file containing a list of mirrors for this repository. The mirrorlist and baseurl are mutually exclusive ▢ enabled —▶ A boolean control for disabling or enabling the repository. A value of 1 means enabled. ▢ gpgcheck —▶ A boolean control for applying gpg authentication against gpgkey before installing an rpm. A value of 1 means enabled. ▢ gpgkey —▶ A url (file or http) specifying the location of the GPG Key to use for gpg authentication. Ignored unless gpgcheck is enabled.

8. Automatic updates via yum

To enable automatic updates via yum, you'll need to run the following commands:

chkconfig yum on
service yum start

9. Removing packages

Packages can be removed using either yum(1) or rpm(1). For example, a package identified via rpm's query command:

bash $ rpm -aq|grep kernel
kernel-2.6.11-1.35_FC3
kernel-devel-2.6.11-1.35_FC3
kernel-2.6.12-2.4_FC3
kernel-devel-2.6.12-2.4_FC3

Can be removed with the yum(1) command:

bash # yum remove kernel-2.6.11-1.35_FC3

Or with the erase option of the rpm(1) command:

bash # rpm -e kernel-2.6.11-1.35_FC3

Using yum(1) is preferable as it also clean up the yum cache repository as well as the rpm packages. The remove option of yum also removes dependent modules. In the following example, removing a kernel module also removes a dependent ntfs module:

bash # yum remove kernel-2.6.11-1.35_FC3
=============================================================================
  Package                 Arch       Version          Repository
  Size
=============================================================================
Removing:
  kernel                  i686       2.6.11-1.35_FC3  installed 47 M
Removing for dependencies:
  kernel-module-ntfs-2.6.11-1.35_FC3  i686  2.1.22-0.lvn.3.3  installed  242 k

10. Fedora Legacy

Note: As of 2007, the Fedora Legacy Project is now discontinued

The fedora legacy repository contained some useful security related enhancements to packages. This project has been SHUTDOWN AS OF Feb 7 2007. The master repository is stale but individual repositories may be available for a while yet, refer to the Fedora Legacy mirrorlist.

11. RPMforge

RPMforge is a joint effort of 3 repositories: FreshRPMS, Dries and DAG. The DAG repository is not a standalone repository anymore. Use either Dries or other repository that packages the RPMForge repo. The most useful component of the RPMforge repository is the DAG component

Note: The RPMforge and Livna are not compatible. There is some overlap between the two in that they contain many of the same rpms. I prefer RPMforge.

12. ATrpms

ATrpms is a 3rd party rpm repository with a focus natural sciences, especially high energy physics. Examples of packaged software in ATrpms are numerical programming and etc for scientific publications. The ATrpms is by no means specific to natural sciences and includes many non-scientific software, like system tools and multimedia packages. The ATrpms signing key can be found on keyservers, within the ATrpms rpm package. The ATrpms website also provides direct http access to the ATrpms signing key.

Currently, ATrpms provides packages that are built for Red Hat Linux platforms. ATrpms is in cooperation with several other 3rd party repositories. Refer to the ATrpms website ATrpms website for more information.

Note: I am unaware of the compatibility of ATrpms with the Fedora Core repository and with RPMforge or Livna. The safest approach is to keep this repository disabled and enable it on an ad-hoc basis with the --enablerepo option.

13. Livna

The Livna packages provide rpm's for mp3/mp4 support, such as lame, mpeg123, Faad and sox. Livna also package vendor specific graphics drivers such as drivers for the nVidia and ATI range of hardware. Livna provide an rpm containing the required .repo and GPG keys. Typically Livna provide a fedora-release specific version of their configuration rpm. For example the Fedora core 7 Livna configuration rpm can be installed from:

bash # wget http://rpm.livna.org/livna-release-7.rpm

Note: Livna is not compatible with RPMforge. If a choice has to be made, RPM\forge is far more useful). If using the Livna together with RPMforge be sure to keep the Livna selections limited to mp3 and and related packages, by using the includepkgs directive.

Refer to the Livna Livna website website for more information.

14. Yum and Fedora 7

As of Fedora Core 7, the old Updates and Extras repositories have been merged with the Core repository into a super-repository called Everything. Whereas, prior to FC6, a yum(1) configuration might typically include core, extras and updates, now, in FC7, the single everything repository is all that's needed. The differences in repository directory structures between FC6 and FC7 make this evident. See for example, the following PlanetMirror repository for Fedora Core: ▢ Fedora Core 7 (and beyond): Clean and simple - a single repository ▶ Everything: .../fedora/linux/releases/7/Everything/x86_64 ▢ Fedora Core 6 (and prior): Multiple, separate repositories for Core, Updates and Extras: ▶ Core: .../fedora/linux/core/6/x86_64Updates: .../fedora/linux/core/updates/6/x86_64Extras: .../fedora/linux/extras/6/x86_64

15. Limiting a repository

A repository can be constrained to a limited range by using the includepkgs directives. If repository has includepkgs, then the yum(1) command will limit results of (searches and installs) to those rpm's specified. The includepkgs is a space separated list of rpm's that the repository is limited to. Example:

includepkgs=mplayer mplayerplug-in mplayer-gui a52dec faac faad2 ffmpeg gsm lame \
        libdvdread libmad libmp4v2 mplayer-fonts xvidcore lame-libs libdts libdvdnavmini

16. 32-bit repository under Linux-64

At this time (3 Jun 2007) there are many applications that do not work well on 64-bit linux. Examples are Firefox, which has a 64-bit version but that version does not handle plugins at all well (c.f., the java plugin, mplayer and etc). The solution or more specifically a workaround, exists which is to use the 32bit version of these problematic applications.

The 32-bit libraries of an application will happily co-exist with the it's 64-bit counterparts and the platform version of an rpm can be selected by specifying the architecture such as x86_64 or i386, e.g., ▢ mplayerplug-in.i386 - Install the 32-bit :rpm of the :mplayer plugin ▢ mplayer.x86-84 - but install the 64-bit :rpm the :mplayer binary, codecs and libraries.

Yum can be configured to specify repositories for 32-bit rpm's by simply hardcoding the value for $basearch. The recommended configuration for specifying 32-bit rpms on Linux-64 is to specify a constrained list of packages for the Fedora Core, Extras, Updates and Livna repositories, as follows:

[core-i386]
name=Fedora Core $releasever - i386
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/i386/os/
enabled=1
gpgcheck=1
includepkgs=firefox libgnomeui libbonoboui libgnome SDL fribidi libXv libXvMC libdv mikmod slang
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[extras-i386]
name=Fedora Extras $releasever - i386
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/i386/
enabled=1
gpgcheck=1
includepkgs=aalib enca imlib2 libmpcdec lirc lzo openal portaudio xmms-libs libid3tag
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1
[updates-i386]
name=Fedora Core $releasever - i386 - Updates
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/i386/
enabled=1
gpgcheck=1
includepkgs=firefox libgnomeui libbonoboui libgnome SDL fribidi libXv libXvMC libdv mikmod slang
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[livna-i386]
name=Livna for Fedora Core $releasever - i386 - Base
baseurl=http://rpm.livna.org/fedora/$releasever/i386
failovermethod=priority
enabled=1
gpgcheck=1
includepkgs=mplayer mplayer-gui mplayerplug-in a52dec faac faad2 ffmpeg gsm lame libdvdread libmad libmp4v2 mplayer-fonts xvidcore lame-libs libdts libdvdnavmini
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-livna

Stuart Moorfoot 3 Jun 2007 © foo@bund.com.au


Backlinks: :ImageMagick :adsl :alien :baazar :bash :bash completion :dvd :eagle-atm :fedora :firefox :fonts :gnome :hdd :mobilephone :mount :mp3 :nvidia :oracle :proxy :pulseaudio :remind :rpm :wifi