# yum list kde*
searches for any packages containing kde
, which is useful if you want to selectively update packages. Use the command shown here to update a single package:
# yum update <
Or use this command to update more than one package at a time:
# yum update <
Of course, when yum
is processing the required packages, it also solves any dependency issues. You will get the opportunity to see not only the packages that will be updated, but also which packages were required to satisfy dependency issues.
yum
is not developed solely by Red Hat. Instead, Duke University has the honor of being the creator and maintainer of yum
and its related technology. In particular, Seth Vidal has spent a lot of time and effort ensuring that yum
improves in both speed and functionality. Subscribe to the yum
mailing list at https://lists.dulug.duke.edu/mailman/listinfo/yum for the latest information and updates on yum
. Seth has now moved across to Red Hat and spends most of his time working on yum
!
Running yum
Noninteractively
Running yum
can involve dependency resolution and a number of updates, which can itself take a long time to download, especially if you are connected to the Internet via a slow connection. Even with a relatively good connection (8Mbps DSL), it can take a while to download a few hundred megabytes of packages. There is, however, an option within yum
that you can use to make it run with minimal user intervention. The syntax looks like this:
# yum -y update
This tells yum
that when a question is asked, it is to automatically assume the answer to be yes. This way you can go away and do other tasks rather than waiting for yum
to finish downloading all the headers and ask you whether you want to go ahead and install the packages.
Using yum
to Remove Packages
So far we have looked at using yum only for installing software, but that is only a small part of its capabilities. It can also be used to remove packages that are no longer required and to give detailed information on installed and available packages. The syntax is similar to the installation and update functions of yum
.
As mentioned earlier, yum
interfaces with the rpm
command to use it for querying the local package database. If you need to remove a package, you can use yum remove <
then scans the local file system, finds the package named, and checks for potential dependency problems. This way, you will never remove a package that could crash your system. You are prompted to give confirmation that you want to remove the required package; then yum processes the package and its dependencies to remove them safely.
Maintaining yum
Over time yum
can build up a large cache of RPM headers and other assorted information that can gradually build up to occupy a sizable amount of room on your hard drive. This cache is kept in /var/cache/yum
, and you can manage it by using the yum command with your choice of options.
After yum finishes with the packages it downloads, it does not automatically delete them from the system, even though you might have no further use for them. After only one invocation of yum update
, I found that my cache file had blossomed to just over 500MB in size. A few months down the line and this could grow exponentially as new updates, bug fixes, and security patches become available.
As with all things in Fedora, you get a choice as to what you want to remove: the pack ages themselves, the RPM header files, or both. To clean the system of just the packages, use the following command:
# yum clean packages
When I did this, yum
removed all the downloaded packages on my system, saving me 450MB immediately.
If you also want to remove the header files, you can use the following command:
# yum clean headers
This saved an extra 10MB on top of the 450MB that removing the packages gave me.
If you decide to remove the header files, yum
has to re-download them the next time that you decide to update your system. This can take a little bit of time, but should not be a problem if you have a fast broadband connection.
Finally, if you want to remove both the packages and the headers in one quick step, you should use this command:
# yum clean all
This removes all packages and headers from the cache. We suggest using the command just to clean the packages, especially if you are on a slow Internet connection, because keeping the headers saves you time in future updating sessions.
Using yum
to Manage Package Inventory
Another useful feature of yum is its capability to list several sets of packages. There are a few options that you can list, including packages that are currently installed, packages that are available to be installed, and packages that have updates available.
The command is as follows:
$ yum list <available> <updates> <installed> <extras>
> available
— This lists the available packages in the configured repositories.
> updates
— This lists the available updates for currently installed packages.
> installed
— This lists the packages currently installed on the