Apt-rpm Questions and Answers

The Questions



The Answers

Why is apt better than rpm?
On rpm based Linux systems, if you want to install a new application that requires other "dependencies" to be installed first, you have to manually install the dependencies yourself. Even supposedly easier-to-use tools such as Kpackage don't automate the process of fetching dependencies, but apt-get does so nicely.
top

Is that all?
No, apt-get's capabilities go far beyond simplifying installation. Most notable is an option that updates your system by comparing the release levels of the software on your system to those of a remote benchmark site. This process can be automated as much or as little as you like. For instance, you can choose to upgrade critical software--such as security--automatically, while being more selective about upgrading more conventional applications.
top

Still not impressed?
Read the articles: "An RPM port of APT" and "APT beats RPM". If you are still not impressed, It's hopeless; stop further reading and continue updating your system(s) the way you're used to.
top

Are all rpm problems eliminated?
No, the availability of apt-get doesn't eliminate all RPM-related problems (most notably Red Hat's tendency to make gratuitous and backward-incompatible changes in the RPM format).
top

Why provide something new (apt-rpm) of something that is already there (apt-deb)?

top

Does apt-rpm violates the Linux Standard base?
No, apt-rpm does not violate the Linux Standard Base (LSB). Apt-rpm is an extra shell around the rpm packages, which provides additional functionality and better dependency administration.
top

Is apt-rpm used during install time?
Only if the distribution you're using support apt-rpm. In case the distro does not support apt-rpm you need to setup the apt-rpm system, which you can do with aptate (part of the apt4rpm project).
top

How come that apt-rpm provides a better dependency mechansim than rpm alone?
It seems that rpm does not use all information that is available in the rpm's. Rpm looks probably at a single package only, while apt-rpm takes the repository as a whole into account. It uses this information to determine and solve the dependencies.
top

Can I continue to install rpm packages by myself ?
Yes, you can apt-rpm respects the rpms database.
top

Is it necessary to execute a configuration tool after the apt-rpm has installed packages?
Depends on the distribution you're using. In case of SuSE it might be that /sbin/SuSEconfig needs to be executed after a succesfull update.
top

Is a network connection established when apt-get is being executed?
It depends what has been defined in the /etc/apt/sources.list config file. If remote uri's (ftp, http) have been configured a remote connection will be established to sync the server and client repository information.
top

Is there a graphical frontend available for apt?
There is a graphical frontend available called, synaptic. It can be downloaded from the various apt-rpm repositories.
top

What changes for distributors providing rpm packagers?
Distributors need to setup and support a directory structure that fits in the apt-rpm structure. This repository contains just the standard rpm's. The repository may consists of links to the corresponding rpm packages at the currently in use repository.
top

What changes for developers providing rpm packagers?
Developers who want to share their application(s) with others via apt-rpm, place it just on the web like usual. It can now be installed using apt-get update <uri>. The nice thing is that each dependend package for this application is now automatically downloaded, if it can be found on the provisioned download locations (including DVD, CD, HD, etc. (as specified in /etc/apt/sources.list file)).
top

Are there comparable applications available?
Yes, there are: urpmi from Mandrake. For a nice comparison of all the package mngt systems have a look at the section called "APT and RPM" in the article: "An RPM port of APT". Nice to mention here, is that there is something similar for solaris as well: pkg-get or pkg-utils supporting Solaris, HP-UX, Irix, Tru64, rpm and Aix.
top

Are there any drawbacks?
For end users there aren't really. Maybe for businesses there are. As it so easy to update or even upgrade a sytem it might be that less number of copies of a distributor's release are being sold. However, if the distributor does not provide an easy way to update the system end users may switch to another distribution, supporting apt, apt-rpm, urpmi, etc. This lowers the number of sold copies as well....
top

Can apt be used at non Linux operating system?
Apt has been written fairly independent of the underlying package management system, it's available on solaris as well e.g.
top

Is apt-rpm being used with Red Hat?
There is news about some people successfully using apt-rpm under Red Hat 6.x to manage a large network of machines, with a custom and internal repository of packages. There are also some interesting reports of people having upgraded RH 5.2 or RH 6.x to Conectiva 6.0, after a little manual adjustments of some packages. (see here)
top

What about RPM 4 (Red Hat 7.x)?
Apt-rpm works with RPM 4, the latest version of apt-rpm relies on RPM-4.
top

Where are the available apt-rpm repositories listed?
Look at: Apt-rpm repositories
top

How is Debian's "dpkg" related to rpm?
dpkg is a tool to install debian packages, at an rpm system the tool "rpm" does the same.
top

How is Debian's "dselect" related to rpm?
dselect is a tool that operates (1 level) above dpkg. At an rpm system there is not 1 common tool that does the same. At SuSE this might be YaST2. Perhaps that kpackage can be compared to dselect as well.
top

What is the minimal size for the filesystems; / and /var
Remark: / and /var are seperate filesystems as well as: /boot, /home, /opt, /tmp, and /usr.
Filesystem / must be able to contain at least 2 rpm kernel packages, when using SuSE it seems that 150MB is sufficient.
Filesystem /var must hold many rpm packages when e.g. a dist-upgrade is being performed. When using a regular SuSE setup one may end up downloading up to 400MB! Your /var filesystem must be able to hold all this for a smooth operation of apt.
top

How to get rid of the message: "All your base are belong to us!!"?
Delete the last echo command in the file /usr/bin/genbasedir.
top

I'm getting the error msg: "Error in server response, closing control connection", what's wrong?
You're probably behind a firewall. Use the tag <add_arg> in apt4rpm's mirrorfile and include the wget argument --proxy=off or --passive-ftp. Or specify user wide; in this case add the line "passive_ftp = on" to ~/.wgetrc, or to /etc/wget.
top

Is it possible to prevent packages to be updated automatically?
Yes, it is possible to "hold" packages. Use the configuration variable Hold (apt-0.5.4) or HoldPkgs (apt-0.3.19) in /etc/apt/apt.conf. E.g. as follows:

RPM
{
   Hold {
       "k_deflt";
       "inews";
   };
}
         
Check the current settings with "apt-config dump".
You may also consider using the following method:
apt <action> -o RPM::Hold::="mypkg"
top

Why does apt upgrade almost every installed packages (SuSE)?
This happens when the system has been installed using the packages that have delivered with "the boxed" version of the distribution and the system is then synchronized using the apt server. SuSE e.g. is "recompiling" the packages when they are put on the server. So most of the times it is only a minor number update of the package. To workaround this leave out the component "base" in the /etc/apt/sources.list file. Sometimes there is a Ximian component as well, leave this one out as well as it does not mix very well with the suse version numbering.
There is another strategy possible as well, start with only 1 component in the /etc/apt/sources.list file. This could be the security component e.g. It is now possible to slowly extend the number of available components.
top

Why do I get the error msg: Unable to fetch file, server said....?
The scenario is as follows:

dar:/var/cache/apt/archives/partial # apt-get install kdebase3
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  kdebase3
0 packages upgraded, 1 newly installed, 0 to remove(replace) and 13 not upgraded.
Need to get 17.0MB of archives. After unpacking 34.9MB will be used.
Get:1 ftp://ftp.gwdg.de SuSE/7.3-i386/kde3 kdebase3 3.0-7 [17.0MB]
Err ftp://ftp.gwdg.de SuSE/7.3-i386/kde3 kdebase3 3.0-7
  Unable to fetch file, server said '/pub/linux/suse/apt/SuSE/7.3-i386/RPMS.kde3/kdebase3-3.0-7.i386.rpm: No such file or directory.  '
Failed to fetch ftp://ftp.gwdg.de/pub/linux/suse/apt/SuSE/7.3-i386/RPMS.kde3/kdebase3-3.0-7.i386.rpm
  Unable to fetch file, server said '/pub/linux/suse/apt/SuSE/7.3-i386/RPMS.kde3/kdebase3-3.0-7.i386.rpm: No such file or directory.  '
E: Unable to fetch some archives, maybe try with --fix-missing?

What went wrong? The rpm mirror synched to a newer rpm version of kdebase3, while the apt repository has not been recreated yet. The kdebase3 package was updated to: kdebase3-3.0-16.i386.rpm while apt was looking for version 3.0.7.
This can be checked by ftp'ing into the server, e.g:
ftp ftp://ftp.gwdg.de/pub/linux/suse/apt/SuSE/7.3-i386/RPMS.kde3/
and execute an "ls" in this directory. Change Directory (cd) to the linked directory. Do again an "ls" and check the output...

    2 options:
  1. Just wait untill the apt repository has been resynced with the rpm repository on the server. After the waiting perform another apt-get update.
  2. Download the package involved with ftp into the directory: /var/cache/apt/archive. Apt will now see that the rpm is available and will continue installing the package :)
top

How do to execute a post install script from apt-get?
This requires a change to apt.conf file and a wrapper around rpm. First add the following lines to apt.conf:


Dir
{
  bin
  {
    rpm "/usr/bin/aptrpm";
  };

};

SystemConfig
{
  KernelPkg k_deflt;
  BootMgr /sbin/lilo;
}

This will execute the script /usr/bin/aptrpm (aptrpm-1 in the cvs repository). instead of /bin/rpm. In this script all kind of actions can be programmed. The actions can make made configurable by adding more attributes to the apt.conf file.
This is just an example, it is up to your fantasy to do whatever you you want it to. If you think it is interesting for others, please let us know, we can make it part of the apt4rpm project!
top

How does APT deal with interrupted downloads?
The download will continue at the same bit of downloaded file that was interrupted.
top

Synaptic hangs
The reason could be that the file /root/.synaptic/filter is corrupted. The original file size is about 2.5kB. If it is much bigger it's already a good indication that the file is corrupted. If the command "cat -vt /root/.synaptic/filter" results in strange/unexpected output, as shown below, remove the file and restart synaptic. Synaptic should work now (and if not execute "strace synaptic" to debug the problem).

If the next error is "could not open RPM database:cannot get exclusive lock on database", than check with "lsof | grep rpm" or with "lsof | grep lock" if rpm or synaptic are locking the file. It's now possible to kill the process that locks the rpm database.
If this sounds too complicated just reboot your system...

Than if all of this does not help, the command "rpm --rebuilddb" might help you to get rit of the problem...

linux01:~/.synaptic # cat -vt filters.old  | head -100 | tail -20
};
filter "Broken" {
  section {
    inclusive false;
    sections {
    };
  };
  status {
    flags 0x4;
  };
  pattern {
    patterns {
    };
  };
  priority {
  };
};
filter "Search
Filter^@^@^@^X^@^@^@A^@^@^@pM-4^Z^H^@pR@@^R^L^H^@^@^@^@^@^@^@^@^@^@^@^@^@^E^P^H
^R^L^H^@^@^@^@^@^@^@^@^@^@^@^@^@^R^L^HM-^?M-^?M-^?^?M-`^Q^L^H`@l@A^@^@^@PM-^C^Q^H^@pR@@^R^L^H^@^@^@^@^@^@^@^@^@^@^@^@^@^F^@^@
^R^L^H^@^@^@^@^@^@^@^@^@^@^@^@^@^R^L^H^A^@^@^@M-`^Q^L^HM-X^E^P^HA^@^@^@M-XM-X^X^H^@pR@@^R^L^H^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^R^L^H^@^@^@^@^@^@^@^@^@^@^@^@^@^R^L^H^H^@^@^@M-`^Q^L^HM-`M-Ib@A^@^@^@
top

Is it possible to force apt-get to ignore dependency checks for certain packages?
There's a hack which allows that. But before telling you the trick, let me include a disclaimer:

Ok.. if you have a strong heart, and are still reading, the trick is an option in apt.conf:
RPM
{
   Fake-Provides { "foo"; "bar 1.2"; };
}
This will "provide" the dependencies "foo" and "bar" version 1.2.
You've been warned! :-)
top

Forcing repository preference?
Is there a way (configuration option or similar) to give certain repositories a higher priority than others, to let apt-get pickup packages from one certain repository, even if another repository contains "newer" versions of the same packages?

Yes, it is possible. Have a look at apt_preferences man page. As an example, I have "replaced" a Mandrake Linux with a Conectiva Linux recently. To do that, I've introduced the following lines at /etc/apt/preferences:
Package: *
Pin: release o=Conectiva
Pin-Priority: 1001

Then, everytime I tried to install a package, Conectiva Linux ones had precedence. The interesting part is, when Conecitva's package had a lower version, apt downgraded (!!) it (because priority is < 1000).
More about pinning packages can be found
here.
top

Why is version 1.0.1 not considered newer than 1.0pre/1.0rc? Or pinning a package version.
Imagine that your distributor releases a package with a wrong version scheme. An example of such a version is: bayonne-1.0pre2. If the successor of this package is released and is named bayonne-1.0.8, apt (and similar tools) are not able to determine that 1.0.8 is newer than 1.0pre2 if using normal algorithms. How to deal with this? Use the pinning rule displayed below in the file /etc/apt/preferences;
Package: bayonne
Pin: version 1.0.8*
Pin-Priority: 1001

After installing the package the pin can be removed as most likely the correct versioning scheme will be used.
top

How to transfer rpm arguments via apt to rpm?
For example you want to install an older rpm package (older than the one already installed) with apt, but apt/rpm won't let you normally do that. Never the less by specifying the argument "-o rpm::options::=--oldpackage" the package will be installed by apt.
top

How to define allowed duplicated packages?
Use the option:

RPM {
  AllowedDupPkgs {"^kernel$"; "kernel-smp";};
}
in /etc/apt/apt.conf.
top

Synaptic complains about a missing file /etc/apt/preferences
Create the file yourself by executing:
$ touch /etc/apt/preferences
top

Is it possible to provide an apt repository via a public not privately owned web server?
Yes, it is the procedure for a small repository is described
here.
top

Error: failed dependencies
If you're getting an error report similar to the one below:

Executing RPM (-Uvh)...
error: failed dependencies:
        mod_ssl = 2.8.10-39 | mod_ssl = 2.8.10-47 is needed by
mod_ssl-2.8.10-57
E: Sub-process /bin/rpm returned an error code (1)
it means that apt is about to install a prpm (patch rpm), while the the rpm that needs to be patch is not installed. Remove the component that provides the prpm from your sources.list file and execute the apt command once more. This time it is probably succesfull.
In case the apt repository is build with aptate, all prpm's are stored in a component with the suffix "-prpm".
top

How to rsync an apt repository build up with links?
The command to use is: rsync -r -u --size-only --delete --copy-links rsync://.... <dest dir>

For example:

rsync -r -u --size-only --delete --copy-links \
  rsync://ftp.okna.fr/pub/linux/suse/apt/SuSE/8.0-i386/ /apt/suse/update/8.1-i386/

top

Apt returns with a file conflict error?
After doing apt-get update and than apt-get upgrade I get this message:

"file /opt/kde3/share/apps/kdm/pics/users/BeachBall.png from install of 
kdebase3-kdm-3.3.0-15 conflicts with file from package kdeutils3-3.2.1-61
Error while running transaction."
How can a little picture file "conflict" with anything?

This error message, from the spawned rpm process, informs you that a file will be delivered by a different package. It is up to you to decide to accept this change or not. More often than not it is okay to accept the change. If you think the change is acceptable use apt --force-rpm <the action to be performed> to have the new package accepted.
top



Home
Last modified: 03 October 2004
Feedback