Yum automated software installation and update for Red Hat Linux

Yum is the easiest way to keep all programs up to date. It downloads and installs the latest version of a program. A single command can update all software installed, including third-party software, security updates and operating system. It can do the updating automatically in the night. In this howto, we install yum and make it do all the above.

Yum is similar to, but better than apt, apt4rpm, windows update, up2date, yast and many other package managers I have seen.

Yum works in a safe, standardized way. It uses rpm (Red Hat package manager) for installing programs. Authenticity of packages is checked with strong gpg encryption. Package repositories are just folders on a web server.

This tutorial is for Red Hat 9. If you are using the newer Fedora Core 1 or later, you already have yum installed. For configuring Fedora version, see unofficial Fedora Faq.

We will install yum, then choose trusted packagers and start installing programs. We will also see some yum tips.

(c) Tero Karvinen

Install yum

Red Hat has rpm package manager installed by default. We use rpm to install yum.

Download yum-2.0.3-0.fdr.1.rh90.noarch.rpm

Open command prompt: Main menu (the red hat menu on bottom left corner), System Tools, Terminal. Become root with su -. Notice how your prompt turns from $ to #.

Go to the folder where you downloaded yum. Most likely cd /home/your-user-name/. If you can see the file with ls, you are on the right place.

rpm -Uvh yum*.noarch.rpm

In the command above, rpm -Uvh means installing just like rpm -i you may have used allready. -Uvh just displays some extra info and erases old version of program if necessary. You can rpm -q yum to see if yum is installed. It should tell you the version number of yum.

# rpm -q yum
yum-2.0.3-0.fdr.1.rh90

Add trusted packagers to your keyring

In yum, it really does not matter if enemy takes over the internet and fakes to be some website offering software. All software is cryptographically checked before installation (if you have set gpgcheck=1 in yum.conf). To install some software, we must tell yum who we trust.

rpm --import /usr/share/doc/yum-*/Fedora-GPG-KEY
rpm --import /usr/share/doc/yum-*/RPM-GPG-KEY

We installed the key of Red Hat Inc, as we obviously trust the company that compiled our operating system. We installed Fedora's key, as we have allready installed yum packaged by Fedora. These two keys are probably the most usefull ones.

Start installing software

yum install lynx

Because it is your first run, it first downloads headers that contain information about what is available. This can take as long as 20 minutes, but it only needs to be done once. Yum prints the names of headers it downloads

Gathering header information file(s) from server(s)
Server: Fedora Linux / stable for Red Hat Linux 9 (i386)
Server: Fedora Linux / testing for Red Hat Linux 9 (i386)
Server: Red Hat Linux 9 (i386)
Server: Red Hat Linux 9 (i386) updates
Finding updated packages
Downloading needed headers
getting /var/cache/yum/fedora-stable/headers/leafnode-0-1.9.43-0.fdr.1.rh90.i386.hdr
getting /var/cache/yum/fedora-stable/headers/libzvt-devel-0-2.0.1-0.fdr.5.rh90.i386.hdr
getting /var/cache/yum/fedora-stable/headers/mhash-devel-0-0.8.18-0.fdr.1.rh90.i386.hdr
   [..]
Resolving dependencies
Dependencies resolved
I will do the following:
[install: lynx 0-2.8.5-7.1.i386]
Is this ok [y/N]: y

Accept with y and press enter. Yum downloads requested packages and installs them.

If any additional programs, dependencies, are needed, yum will ask if you want to install those too. For example, lynx needs perl-CGI, so if we don't have that installed yet, yum installs it.

Calculating available disk space - this could take a bit
lynx 100 % done 1/1 
Installed:  lynx 0-2.8.5-7.1.i386
Transaction(s) Complete

Now all users can use lynx right away. No reboots, no changing cdroms, no nuisance. If you are still root (have a # on your command prompt), exit.

Now try lynx. If you can run lynx (the text mode web browser), you have succeeded. Congratulations, you have now installed the state of the art package manager yum.

Yum tips

That was just too easy, wasn't it? To have some fun with yum, try

yum list "*ssh*"	# lists packages that have "ssh" in the name
chkconfig yum on        # make yum update all programs every night
yum remove up2date      # remove a program, dependencies handled
yum -y install curl     # -y answers "yes" to all questions

Links

Duke University 2003: Yellow dog Updater, Modified. Official homepage of yum. Has a list of yum repositories.

Fedora Project 2003: Fedora.us. The biggest yum repository, now merging with Red Hat.

Saou, Mathias 2003: Freshrpms.net. The first big automated software repository for Red Hat. Best packages of many programs, such as mplayer and sylpheed. Good documentation.

To use yum in some real application, try some of my other tutorials. Most of them use yum to install software.

Copyright

Tested with Red Hat Linux 9 Shrike

Copyright 2003-09-28, 2003-09-29, 2003-11-05 (yum list ssh), 2003-11-19 (Fedora Core advise+link), 2004-05-14 (example commands upd) Tero Karvinen. GNU Free Documentation License. XHTML Basic 1.0