Smart Package Management on RPM-based Linux


All modern Linux distributions include some kind of auto-update tool(s) which scan remote file repository, and then download and install updated RPM(s). However, these tool(s) in most cases are capable to check and install RPM(s) only supplied by manufacturer of particular Linux distribution. What if you have large number of third-party or home built RPM(s)? Fortunately, there is a bunch of Open Source tools capable to complete this chore in different ways (to satisfy most if not everyone).


I have tried a lot of different tools and finally two of them become my favorite - GRAB and apt4rpm.

First of all, a few words about update process. The just-released updates should not be installed immediately unless they really fix some serious bugs or security holes (these updates, in turn, may be buggy, too). Additionally, installing updates automatically using cron jobs is really bad idea because it may replace stuff used by running processes which shall be restarted after and what no update tool will actually do. However, it is a good idea to mirror updates via cron on local ftp server with programs like "rsync"," mirror" or whatever else you like.

Here is how I have done this (of course, your receipt might be different). All updates (among other useful stuff) are mirrored inside "/home/ftp/mirrors" shared directory (view screenshot) which is accessible via ftp, Samba and Netatalk. If you have SuSE Linux, you may use the same layout (you can get my mirror script here).


GRAB (Greg's RPM Application Builder) is simple to configure yet very effective tool. After editing configuration files according to your setup you only need to run in superuser mode "grab --update" to update remote RPM cache and then "grab --sysupdate" to check system for outdated packages. GRAB will present you list of packages where you can choose which you would like to upgrade.

Num S Package name Version Installed Arch Server Desc
1 U apache 1.3.23-120 1.3.23-73 i386 SuSE_Main_Update
2 U opera 6.01-217 6.0-215 i386 SuSE_Main_Update
3 U yast2-module-autoinstall 2.5.26-0 2.5.24-0 noarch SuSE_Main_Update

Please note that GRAB 1.0.3 (which I am currently using) do not perform recursive scan of RPM directories, so you have to manually list them in GRAB "servers" file. May be in the future this feature will be implemented.

You can download my GRAB configuration files here.


apt4rpm is a front-end derived from Debian/GNU Linux Advanced Package Tool (APT) for RPM-based distributions (Debian uses its own deb package format). Unlike GRAB, apt4rpm cannot simply scan directory with RPMs and compare them to installed ones. apt4rpm requires so called APT repository. You may use either existing repositories available on various servers (supplied with default configuration files) either create your own(s). In first case just run consecutively the following commands as root: "apt-get update" (to download APT database), "apt-get check" (to check whether your existing system have unsatisfied dependencies), "apt-get -f install" (to install required packages and fix broken dependencies) and finally "apt-get -u upgrade" to display list of newer packages available and confirm upgrade process.

Setting up your own APT repository is a little bit tricky.

  1. Create APT top-level directory with proper permissions where you would like to keep update RPMs and APT database (for example "/home/ftp/mirrors").
  2. Copy your update RPMs here.
  3. Copy entire Linux distro here (otherwise you most likely will not be able to use advanced apt4rpm features like installing any package available in distro with dependency resolution).
  4. Edit "aptate.conf" and "mirrorlist.your_distro-version-CPU_architecture" according to your distribution and APT repository setup (foe SuSE Linux 8.0 i386 it will be "mirrorlist.SuSE-8.0-i386").
  5. Run "aptate" to scan your RPMs and create APT database.
  6. Copy content of "your-APT-directory/apt/your_distro/version-CPU_architecture/examples/sources.list.*" into "/etc/apt/sources.list".
  7. Run apt commands described at the beginning of this paragraph.

Among easy update process apt4rpm offers a number of other benefits like the ability to upgrade the whole distro or really smart package management.

Suppose you have package a which depends on package b which in turn requires package c. If you install package a (with "apt-get install a") packages b and c also will be installed. If you decide to delete package c from the system (with "apt-get remove c") packages a and b will be removed, too (However, in case of removal of package a with "apt-get remove a" packages b and c will not be deleted because they are functional without a).

In short, apt4rpm may automatically handle RPM dependencies if RPMs are available in local or/and remote APT repository (which may be updated, and then re-indexed whenever required with "aptate" command).

My apt4rpm configuration files used to maintain Linux workstation with my own local APT repository are available for download here.

MacGuruHQ and MacGuruHQ Logo

Copyright© 1996 - 2002 by Andrei Verovski. All right reserved. Content may not be copied in whole or in part, through electronic or other means, without the author's permission. MacGuru Logo (blue penguin) by Sergey Orehov.