System Update with YUM

Keeping your Linux system up to date with the latest security fixes and software updates can be a real pain. But it doesn't have to be.

Package management front-ends work a bit like Micro­soft's Windows Update service. They access a repository of available software and synchronise the software on your computer with the latest versions available on the repository. Along with this update function, package management front-ends can also be used to install new software, and to remove software without breaking other applications.

YUM, or Yellow dog Updater Modified, is a package management tool for Red Hat Linux-derived distributions. What makes YUM special is its simplicity. As you'll see in this article, with the use of only a couple of commands it's easy to keep your system up to date with the latest fixes. I'll also show you how to build your own local repositories to save on network bandwidth if you're deploying updates to several Linux systems.

Installing YUM

The YUM client and server are distributed together in a single package. YUM is already included in Fedora Core 2. I've included RPMs of YUM for each supported distribution on November 2004's cover CD. To install YUM, type the following command in a shell as root:

$ rpm -ivh yum-1.0.3.noarch.rpm

If you want to set up a YUM server, you'll need a Web server running: for example, Apache. Apache is included with most distributions and a copy has been included on November 2004's cover CD. After installing Apache, you'll need to allocate some disk space to your YUM package archive. On my system, I'm using YUM to maintain both Red Hat 9 and Fedora Core 2 systems. I've allocated 10GB of space on a partition mounted as /yumdata. After mounting the drive I made a symlink to my Web server's tree with the command:

$ ln -s /yumdata /var/www/html/

Now when I browse my Web server, my YUM repository will be available under http://webserver/yumdata

Click here to view a screen shot.


The Fedora Legacy Project ( is a group of volunteers who, with the support of Red Hat, are prolonging the lifespan of many Red Hat-based Linux distributions. As each new version of Red Hat Linux & Fedora are released, older versions become unsupported. This means that security and bug fixes are no longer provided for these older distributions, effectively forcing anyone using the distribution into upgrading to a newer version. If you've got an older version of Linux working well, the Fedora Legacy Project might help you keep it running for a while longer yet.

Using the client

YUM gets its list of repositories from the file /etc/yum.conf. An example entry in this file is:


By default, this file will contain entries linking you to the update sites for your distribution.

The main activity you'll be using YUM for is updating your system. To perform an update, in a shell as root type the following command:

$ yum update

Depending on how out of date your system is, you may need to download anywhere from 100KB to several hundred megabytes. Installing packages is easy with YUM, as it handles all of the dependency resolutions. So, to install an add-on package such as MPlayer (see the sample yum.conf included on the cover CD for an available repository) which relies on several smaller packages, the following command can be used. Each package required by mplayer-gui will be installed automatically:

$ yum install mplayer-gui

The name of the package as specified in the RPM database is "mplayer-gui". To see a list of all the packages available in your YUM repositories, use the following command:

$ yum list

That's it, just three simple commands are all you need to use YUM effectively. It's a good idea to run regular updates. Get in the habit of running a YUM update every now and then. The more often you update, the less time each update will take.

APT: An Alternative System

APT is an alternative package management tool. Originally developed for the Debian Linux distribution (, it has since been ported to support RPM-based distributions as well. APT is a lot older than YUM, and supposedly more robust than its younger counterpart. However, I've never encountered problems with YUM in the time I've been using it. The Debian version of APT, APT-DEB is included in Debian by default. In fact, the entire distribution is built around the APT-DEB tool. APT-RPM, on the other hand, is available as a third-party add-on for most distributions from its homepage: I've included binaries of APT-RPM for many distributions on November 2004's cover CD.

So why use APT over YUM? The best argument is probably software availability. Many major third-party package Web sites such as and the DAG RPM Repository ( are accessible via APT-RPM. Recently these sites have begun to add support for YUM as well, but APT is still more widely used, especially where less-mainstream RPM-based distributions are concerned.

Setting up an APT repository is similar to the process involved for building a YUM repository. You will need a working Web server and a fairly large area of disk space available to store RPMs. The command used by APT to build a repository is named "genbasedir" and is used in a similar way to yum-arch.

Of the two utilities, I prefer YUM. The differences are subtle, but YUM feels a bit lighter and ties in with Red Hat distributions tightly. If you're using another distribution however, APT is the only way to go: but there's no major downside to either option.

Click here to view a screen shot.

Building a YUM repository

The first repository you should build is a complete mirror of the RPMs for the distributions you'll be using YUM with. This comes in handy, mostly for resolving obscure dependencies for RPMs you'll be installing from other repositories. You never know when a package will rely on a set of fonts that isn't usually installed. To build this repository, simply copy the contents of the RPMS directory from each CD of your distribution to a directory on your hard disk, for example /yumdata/fedora/core/2/os.

Once you've collected all of the RPMs together, type the following command to build the repository:

$ yum-arch /var/html/www/yumdata/fedora/core/2/os

If you add RPMs to this directory later on, re-run this command to up­­date the list of available packages.

Using the same method, you can now build other repositories containing extra software and distribution updates with the same command. A good idea would be to collect your favourite add-on software, for example MP3 plug-ins and media players such as MPlayer, into a directory for easy deployment to all of your systems.

Once your repositories are built, add entries to each client's /etc/yum.conf file and you're done.

Distributions supported by YUM
Red Hat Linux 7.3-9.0
Fedora Core 1 & 2 Red Hat Enterprise Linux Mandrake Linux 9.2

Alastair Cousins is a System Administrator by trade and was first attracted to Linux in 1994 after discovering it was not only free, but included a port of DOOM. In his spare time he records music while keeping up an unhealthy dependency on coffee.

Join the PC World newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Alastair Cousins

PC World
Show Comments

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Matthew Stivala

HP OfficeJet 250 Mobile Printer

The HP OfficeJet 250 Mobile Printer is a great device that fits perfectly into my fast paced and mobile lifestyle. My first impression of the printer itself was how incredibly compact and sleek the device was.

Armand Abogado

HP OfficeJet 250 Mobile Printer

Wireless printing from my iPhone was also a handy feature, the whole experience was quick and seamless with no setup requirements - accessed through the default iOS printing menu options.

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?