November 19, 2007

Supercharging package management with yum plugins and utilities

Author: Bruce Byfield

Fedora's Pirut is a useful tool for basic software installation and package searches. However, if you really want to take control of package management, you need to get back to basics with yum. Just as, on Debian systems, dpkg is the back end underlying apt-get and graphical tools such as Synaptic, so on RPM systems, yum is the hidden power behind Pirut and the Pup updater. Not only does yum have more options than Pirut, but you can enhance it with additional plugins and utilities, many of which work only with yum.

Like Pirut, yum can install packages individually or by groups, search, or display package information. However, yum also includes a number of commands unavailable from Pirut. Most of these commands are self-explanatory, such as update, localinstall, clean all, and repolist (a list of available repositories). In many cases, too, yum commands are more specific than anything available with Pirut; for instance, the list command can take eight separate actions and clean five.

In addition, yum also includes a variety of general options. For instance, you can choose whether to run yum in verbose (-v) or quiet (-q) mode, or to assume that the answers to all questions that arise is yes (-y). Similarly, you can set the seriousness of error messages that display using -e number or prevent a specific package from being installed or updated with --exclude. A few of these options can be set permanently in /etc/yum.conf.

Yum plugins

As if this built-in functionality were not enough, yum's capabilities can be further extended by plugins written in Python and installed in /usr/lib/yum-plugins. Fedora 8's repository contains about a dozen plugins, each of which extends yum's functionality by adding new options to the basic command. A quick Web search reveals an active development community for plugins, so others are no doubt forthcoming.

Several yum plugins allow you to protect yourself against the accidental upgrading of files. yum-protect-packages prevents you from overwriting yum and its dependencies, such as rpm, Python, and glibc by default, and allows you to specify a list of additional protected packages. Similarly, you can protect specific versions of a package with yum-versionlock. You may also choose to use yum-protect-base to keep packages from specific repositories from being overwritten, or yum-priorities to specify which repositories should be used first if a package is available in more than one -- two features that can save you untold grief if you use unofficial repositories. Should you upgrade a package and find it broken, you can back out of the difficulty by using yum-allowdowngrade.

Another useful plugin is yum-security, which extend yum with commands and options that ensure that you only install security upgrades. In theory, at least, this plugin should allow you to avoid or at least reduce problems with broken or buggy updates. At the opposite extreme, you can use yum-updateonboot to take the somewhat risky course of always getting the latest package versions each time you restart your computer.

Other plugins help to speed yum's operations. If you use yum-fastest-mirror, yum will attempt to use the fastest mirror in a list first. Another potential timesaver is yum-presto, which will use deltarpms -- packages that contain only changes, not entire packages -- whenever they are available.

Users who are aware of the need to manage .rpmnew and .rpmsave files, which are added whenever a package upgrades a configuration file, may also appreciate yum-merge-conf. This plugin still requires you make individual decisions about whether to delete these files or merge them with existing configuration files, but it has the advantage of asking you to make choices at the time of installation, instead of reviewing the possibilities manually later, forcing you to address a time-consuming but necessary task.

Needless to say, these plugins require some experimenting if you use them in combination. In some cases, a knowledge of official and unofficial repositories may be useful, too. However, if you find the plugins lead to trouble, you don't need to install any of them. Instead, you can use yum's --no plugin option to have the program revert to its base behavior and ignore all plugins.

Yum utilities

Several independent programs may also help you to get more out of yum. If you prefer a graphical program to the command line, you may find that either KYum or yumex somewhat more versatile than Pirut, although still not a match for yum. A third graphical tool that may be convenient for dealing with yum is repoman, which allows you to add, delete, activate, and deactivate package repositories from the desktop.

yum-utils is worth installing for command-line work. Developed at Duke University, yum-utils is apparently intended as a collection of tools, although to date it has only two. The yumdownloader utility is similar to the yum-downloadonly plugin, but includes more options, including the ability to specify a directory, add required dependencies to the download, or download the source package. Even better is package-cleanup, which assists in removing packages that are no longer needed. What makes package-cleanup especially useful is that you specify the exact type of package that you want to remove: duplicate packages (--dupe), packages with dependency problems (--problems), packages no longer available in any of the repositories you are using (--orphan), or old kernels (--oldkernel). If you choose, you can add --count=number with --oldkernel to set the number of kernels that are kept on the system, a setting that is defined in /etc/yum.conf, and whose default of 2 is almost certainly too low if you regularly upgrade kernels and want to ensure that your system is bootable. Taken together, package-cleanup's options are a welcome addition to yum's already extensive cleanup options. Personally, I find it indispensable.


Which of the available plugins and utilities you use depends on your preferences. However, all of them extend your options, and many extend your available information as well, so they are worth exploring. Pirut, kiyum, and yumex are all becoming increasing polished but, as this survey shows, much of the most interesting work in RPM package management is still being done at the command line, and much of it with yum itself.

As a Debian die-hard, I'm fascinated by how far yum has come in the last few years. From the slow, somewhat limited tool of several years ago, yum has become a thoroughly modern package management tool comparable in every way to apt-get, and nowhere is its efficiency more obvious than in its plugins and related utilities.

something you may not always want, if your concern is with a page as it is at a particular date and time.

If memory is a concern for you, you can limit the number of crashed sessions to save, as well as the maximum number of closed windows and tabs remembered per session. You can also save the closed tabs and windows between sessions, although that can quickly become cumbersome if you do it regularly. More likely, you'll want to do that only occasionally, and only for very large projects, after which you'll want to select Clear List from the Undo Close tab of the Options window. Otherwise, if a tab or window is important enough to keep available, you will probably want to save a session in which important closed items are already restored.

More advanced users may want to change the default format for session names or where they are stored on the Advanced tab. On the same tab, you can choose to encrypt saved sessions for the sake or privacy. However, as the tab warns, encrypted sessions can only be opened in Firefox user profiles that share the same key3.db and cert8.db files, and require use of the master password as well.

You can think of Session Manager as a kind of meta-bookmarking tool, preserving and restoring groups of related bookmarks much more quickly than you could manually. And, should Firefox crash, it can save you from having to retrace your steps via the browser history step by painful step. If you are a heavy user of tabs, you may find it as indispensable as I have.

Every Monday we highlight a different extension, plugin, or add-on. Write an article of less than 1,000 words telling us about one that you use and how it makes your work easier, along with tips for getting the most out of it. If we publish it, we'll pay you $100. (Send us a query first to be sure we haven't already published a story on your chosen topic recently or have one in hand.)


  • Tools & Utilities
  • System Administration
Click Here!