Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:

HOWTO: Install Apt for RPM in Fedora Core 1

by Jorge Gallegos

Some of you may know about it for quite some time, some of you don't, maybe some of you have even used it in another Debian based distro, or even in another RPM based distro. I'm talking about a great (IMHO) tool.

The Apt tool was first developed by the Debian community, and later ported to RPM based distros by Conectiva Linux. This tool was called Apt4RPM. Basically the apt tool is a front-end for the package installation in these distros, be it a set of .DEB or .RPM packages. But it is at the same time much more, giving the user to install just one package and automatically resolving all the dependencies this single package may have.

"But YUM already does all of this, and it comes with FC1!!!" you may feel the need to yell at me, the thing is, apt is better. Don't get me wrong, yum is a beauty by itself, I have used it and it's wonderful. But apt not only keeps your box up-to-date, it is also capable of handling a complete version upgrade. In fact, you can upgrade your RH9 box all the way up to FC1 with just one instruction (well, maybe 2). So if you haven't downloaded the Fedora disks and you have laying there your RedHat 9 disks (and a good bandwidth, or patience :-]), you can install RH and then make a dist-upgrade.

First of all, you need to download the latest stable Fedora apt4rpm package and install it

$ wget

100%[====================================>] 807,357        8.34K/s    ETA 00:00

`apt-0.5.15cnc1-0.fdr.3.1.i386.rpm' saved [807357/807357]

$ sudo rpm -ivh apt-0.5.15cnc1-0.fdr.3.1.i386.rpm
This package already comes with some repositories configured, the config file for this is (as you may have guessed by now) /etc/apt/sources.list, if you check the content of that file, you'll see something like this:
$ cat /etc/apt/sources.list

# Fedora Core + Extras repositories
# University of Hawaii Honolulu, Hawaii, USA
rpm fedora/1/i386 os updates stable
rpm-src fedora/1/i386 os updates stable

After this, you are ready to start using the apt tool, if you want to put your system up-to-date you will need this two commands:

$ sudo apt-get update
$ sudo apt-get upgrade
The first one will update the package lists available in the repositories, this can take a while depending of your connection but you don't need to run this command every single time, only if you want to get the latest version of your repositories. The second one will compare your RPM database against the updated lists, and if any package in the apt repository it will be marked as installable. If your system requires more than 1 file to be installed and no dependencies, then it will be installed right away, if there dependencies then you will be prompted to accept the download, it gives you an estimate of the total download weight and how much disk space will be required after the install process.

But you can search thru the apt repository too!, how to do so?, simple, suppose that we are searching for the package gaim:

$ apt-cache search gaim
And it should return something like this:
gaim - A GTK+ clone of the AOL Instant Messenger client.
gaim-encryption - An openssl encryption plugin for gaim
It returns all the packages that contain the word we are searching for (grep style).

At the beginning of this howto, I said that it was possible to do a complete version upgrade of an entire system. Debian fans use to say that you only need one single linux installation, and then you can upgrade it as many times as you want. Despite the problems that RPM dependencies can bring, it is possible with apt.

$ sudo apt-get update; sudo apt-get dist-upgrade
That's all!, obviously, you need an apt repository (the official, and the less repositories you have while doing so, the better to prevent version mixing)

In synthesis, these are the most common commands for using apt:

apt-get update
    Download package lists.  Packages change several times daily, so do this often.
apt-get upgrade
    Update all packages.
apt-get dist-upgrade
    Update system version.
apt-get install <packagename>
    Install/upgrade specific package(s) (and its dependencies, if missing any).
apt-get -f install
    Fix packages if something went wrong during an installation.
apt-get remove <packagename>
    Removes package and all the dependencies not shared.
apt-cache search <word>
    Search all known packages entries (descriptions etc) for <word>.
apt-cache show <packagename>
    Show basic information about a package.

Also, if you need a graphical front-end for this operations (personally I rather use the command line) you can download the Synaptic apt front-end from here. It's pretty self-explanatory, is up to you the use of commands or click & double-click.

All this text was consulting the Fedora HOWTO, and from previous Debian experience ;-)