Power Upgrades with apt4rpm

The Advanced Packaging Tool isn't only for Debian any more. Do automatic dependency checks on RPM-based systems too.

Keeping your system current with the latest and greatest can be a full-time job. Package management tools have simplified many installation tasks, but what package management system you use always has been distribution-dependent.

If you're running Red Hat, SuSE or Mandrake, you have been running the sturdy and well known Red Hat package manager (RPM). Certainly easier to deal with than compiling from source, it too can be fairly complicated to use.

If you've ever had experience with a Debian-based system, you know that keeping a system updated is little more than a command away. The Advanced Packaging Tool (APT) simplifies things immensely. Simply type apt-get update to see what's new and apt-get install package to get it. Is a new version of your distribution out? Type apt-get dist-upgrade, and you're on your way. What many folks don't know is it is indeed possible to have the best of both worlds. Thanks to the magic of free software and a terrific team of Brazilian developers, you can use APT with your RPM-based distribution.

APT for RPM (apt4rpm) began when Conectiva S.A. in Brazil decided to create a new distribution. The idea was to use RPMs, yet have the simplicity and dependency checking that APT offers. So apt-rpm was born, the method Conectiva uses to update its distribution.

Why apt-rpm?

The chief advantage APT has over RPM is this: how many times have you downloaded what seemed to be a perfectly good RPM and discovered during the install that you didn't have all the dependencies? This is not an issue with APT. Before the download even begins, APT checks a package's dependencies, compares that list to what's on your system and downloads any additional packages that you need.

What makes this system work is the idea of the package repository. This is a single place where all your software needs can be met. Single RPM packages can exist nearly anywhere on the Net, so when you download one package from one place, there's no guarantee that all of that package's dependencies are stored in the same place. This is when you wind up with a failed dependency error when you try to install your RPM.

The other advantage APT offers is intelligent installs of multiple packages. When you talk about updating something like a desktop environment or Perl, there can be dozens of RPM packages to download—but which package do you run first? APT takes care of this, offering seamless downloads and installs.

The key here is making sure to use the right repository for your distribution. The APT tool itself is distribution-independent and works the same regardless of which distribution you're running, but the packages themselves can install and/or run differently depending on which one you use. Although the differences between distributions are narrowing, it's always best to use applications properly tuned for your system.

I use APT on at least a weekly basis to get current stuff for my SuSE 8.0 system, but I've always been an update fiend. This article outlines the update steps for SuSE; check the Resources section for the proper references for your distribution.


Installation is pretty simple. Odds are you already have the necessary dependencies in place. Your first step to apt nirvana is a visit to Germany, in this case linux01.gwdg.de/apt4rpm. The APT for SuSE site has almost everything you need to get going. Look it over carefully, even if SuSE isn't your distribution. Scroll down to the Software Installation section and go to the download page for the current version of apt4rpm (0.5.4 at this writing; 0.5.5 may be out by the time you read this). Install the RPM. To confirm the install, run:

 rpm -qa | grep -E "^apt-0"

from the command line. The result should display in apt-0.5.4 etc. You're almost ready.

Several GUIs work with APT, but SynAPTic is another Conectiva project that works with RPMs and is easy to use. SuSE users can download it from the same location as the APT client. Even better, once you have APT working, use it to install SynAPTic as a test of the system. Before doing this, you need to set up your repositories.

Setting Up sources.list

Before you can start updating, you need to identify the location(s) of your repositories, so APT knows where to get its packages. These repositories are comprehensive sources for current packages for your distribution. The primary SuSE APT repository is a mirror (updated several times daily) of the same SuSE FTP server that YaST on-line update uses. But a volunteer can set up a repository site with only some packages. You even can set up your own repository with the server-side apt-rpm tool.

APT checks sources.list (stored in /etc/apt) for current repositories. The APT for SuSE site offers a default sources.list file that points to the APT mirrors. Other major repositories can be found at the project page, apt4rpm.sourceforge.net, and individuals regularly announce new repositories on the mailing lists.

sources.list includes the URL (both FTP and HTTP sites are valid) of the repository and the directories included in the repository. You can choose which directories to include in your updates. Some types of packages can put your system at risk, though. For example, SuSE mirrors give APT users access to some experimental and pre-release packages directly from SuSE developers through the SuSE-People and Mantel-Kernel directories. This is okay if you are used to living on the bleeding edge and know what to do when something breaks, but if stability is your goal, you may want to leave out this one. SuSE users can add this repository to sources.list to ensure that APT and SynAPTic are always current (only include the second line if you want the source RPMs):

rpm     http://linux01.gwdg.de/apt4rpm apt-0.5.4 tested
rpm-src http://linux01.gwdg.de/apt4rpm apt-0.5.4 tested

Play with sources.list to see what items work best for you. Feel free to add new repositories as you hear of them. You can edit sources.list from the SynAPTic GUI if you like.

One caution to the Debian-savvy: don't try to add the Debian unstable (or stable, for that matter) servers to your sources.list. You cannot use apt4rpm to retrieve .deb packages for your RPM-based system.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Power Upgrades with apt4rpm

Anonymous's picture

The project name is APT-RPM, not apt4rpm, and the official page of the project is at https://moin.conectiva.com.br/AptRpm, unlike was first mentioned in the article. http://apt4rpm.sourceforge.net is a project using apt-rpm, and is not strictly necessary in any way, unlike was also mentioned.

Re: Power Upgrades with apt4rpm

Anonymous's picture

> What many folks don't know is it is indeed possible to have the best
> of both worlds.

The implicit assumption here is that RH/SuSe/Mandrake are otherwise superior distributions. Care to back that up?

By the way...contrary to what seems to be popular belief, "apt-get" is not equal to "APT". The apt-get command is one of the MANY tools in the APT suite. Does apt4rpm give you apt-cache, apt-proxy, apt-listchanges, apt-rdepends, apt-move, etc etc etc? I thought not.

Re: Power Upgrades with apt4rpm

Anonymous's picture

0hh dont forget apt-mirror, apt-cacher, apt-build, apt-listbugs, listbugs, apt-spy
apt-doc plus all the dpkg commands

i wish they would stop saying apt they mean 'APT-GET' partial functionality

so much for there lets all use redhat and mandrake with apt4rpm like tools
haha i thought not...

Re: Power Upgrades with apt4rpm

Anonymous's picture

You do get apt-cache -- don't know about the rest. No aptitude, which I miss on my SUSE systems -- my only Debian system is my powerbook G3.

Anyway, I do think SUSE is superior to Debian as to out-of-the box configuration. Don't get me wrong, I've been using Linux since 1993, and I've spend evenings calculating modelines for X on my pocket calculator and other evening figuring out how to configure Taylor UUCP, but nowadays I simply don't have the time to get the cd-burner, dvd, asdl connection, dhcp server, sendmail, web server, zope server, mailman installation, sound card, acpi and whatever I am forgetting working from more or less scratch.

I quit using Slackware because SUSE handled a lot of these chores automatically, but after installing Debian on my powerbook and having to mess with PCMIA memory ranges, I felt right back in 1994. So for my next laptop, it'll be SUSE again.