Yum is a package management tool for systems which use the RPM package format. At its simplest, Yum is used to install and remove packages while automatically taking care of any dependancies which are present. To do this, it requires access to a repository of packages. These repositories can be created by an individual (or organization) for public or private use, and the only software that is needed to run a repository is a web server and yum itself, which can be downloaded from http://www.linux.duke.edu/projects/yum/.
To create a repository, first place all the files which you wish that repository to contain in the same directory. For example, should one wish to create a repository of the stock Red Hat Linux 9.0 distribution, take the files from /RedHat/RPMS on each of the installation CD and place them in a single directory. For example, /var/www/Yum/RHL/9/stock
NOTE: The directory structure above is not necessary (all files could be placed in /var/www/Yum) however a similar organization is useful when one is planning on running multiple Yum repositories from the same machine.
Next, in order to make this directory into a Yum repository, run the yum-arch command. Note that as long as you have write access to that directory, superuser privileges are not necessary:
yum-arch /var/www/Yum/RHL/9/stockThe yum-arch command will extract the RPM headers from each package and organize them so that yum can locate them. The repository itself has now been created. Note that every time a package is added or changed, the yum-arch command will have to be re-run.
Client configuration is simple. Yum's configuration file is located in /etc/yum.conf. Configuration for a couple public repositories are already present in the default configuration file, these should be replaced with our own repositories if we intend to use yum as an actual service. To use the example repositories which we have created, add the following lines:
[RHL9] name=Red Hat Linux 9 Stock RPMS baseurl=http://bombadil.cit.buffalo.edu/Yum/RHL/9/stock [RHL9 Updates] name=Red Hat Linux 9 Update RPMS baseurl=http://bombadil.cit.buffalo.edu/Yum/RHL/9/updates
These repositories were created by mirroring ftp://ftp.cse.buffalo.edu/pub/Linux/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/ and ftp://ftp.cse.buffalo.edu/pub/Linux/redhat/redhat/linux/updates/9/en/os/[athlon, i386, i586, i686, noarch]. Updates are current as of 12/16/03 12:12am. We are not planning on updating these repositiories, they are to only serve as an example of how Yum works.
A Yum repository of the stock RHEL WS RPMs is also available, however no updates are contained within it. To use the RHEL WS repository, add these lines to your yum configuration file:
[RHEL] name=Red Hat Enterprise Linux WS 3 for x86 baseurl=http://bombadil.cit.buffalo.edu/Yum/RHEL/WS/3/stock
Once repositories are present in the yum configuration file, run yum update with superuser privileges to download the listing of all files in the repositories and update any packages on the client system for which there are updates.
To install a package from a repository with yum, simply run yum install FOOBAR with superuser privileges, where FOOBAR is the name of the package which you wish to install. If package FOOBAR has any dependancies which can be satisfied with packages within any of the available repositiories, they will also be installed after prompting the user for permission.
Read the Yum HOWTO linked below for a full description of all of Yum's abilities.
The above repositories are not an official service or offering by the University, they just happen to be running on a machine which has a hostmask ending in 'buffalo.edu.' These repositories could disappear at any time, especially if the disk space is needed. Use these repositories at your own risk.