Using apt in an RPM world

Submitted by dag on Tue, 2008/06/17 - 21:00

Everytime I am surprised that people don't know that apt-get works on RPM-based distributions and works much better than the alternatives. Especially in a CentOS/RHEL environment where you have various distribution releases running, apt-rpm allows you to use the same apt version and the same apt features across CentOS/RHEL 2.1, 3, 4 and 5.

In an attempt to persuade you to try out apt, let me denounce some myths about the current apt-rpm:

  • works on RPM packages
  • can do multilib (coexist 32bit and 64bit)
  • does check GPG keys on packages
  • can work with repomd repositories (as used by yum)
  • does work a lot faster than yum
  • is being maintained (although could use more hands)
  • has python bindings
  • has a graphical interface (synaptics)
  • handles multiple repositories much better
  • allows to pin packages by version or repository (and manages cross-dependencies)
  • existed years before yum (and was the only depsolver for a few years in the Red Hat world)

Now, because I can say it works great but you may not believe me, let me make it very simple for you to try it out on CentOS. Here is a quickstart guide...

First we start off installing apt from RPMforge. Follow the guide on the CentOS wiki to configure RPMforge for your system. Then do:

yum install apt

(or alternatively install the latest apt RPM package from http://packages.sw.be/apt/ for your distribution)

and then edit the file /etc/apt/sources.list.d/os.list and add for CentOS:

repomd http://mirror.centos.org/ centos/$(VERSION)/os/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/updates/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/extras/$(ARCH)

This adds the official CentOS os, updates and extras repositories.

Now you can use it, for example do:

apt-get update

to update the locally cached metadata, or do:

apt-get upgrade

to upgrade your system with the latest updates, or yet, do:

apt-get install synaptic

to install a package named synaptic. Try:

synaptic

to start synaptic and use the graphical interface (also available from System > Administration > Synaptic Package Management)

There are a few commands that use the locally cached metadata, the following apt-cache commands are used most often:

apt-cache search keyword

to search the local metadata for packages related to keyword, or:

apt-cache policy package

to show the different versions of a certain package that is offered.

PS And let me also add that the project name is apt-rpm, not apt4rpm (a complete different project).

I have been using Debian for

I have been using Debian for many years, and recently I had to start using Red Hat-like distros, Fedora and CentOS most of the time. I have serious issues against yum: speed, search and many others. Do you have experience with Debian? How different is apt-rpm? Do you use it on a daily basis on your servers?

Much like on Debian

It should be very much like apt on Debian since it is based on those sources. I do use it on a daily basis on a lot of servers and I have done so since 2002.

Why not try it out and give your feedback on this page ?

Heathen.

You think you know a guy....

Okay. Now my issue against

Okay. Now my issue against apt. When you look for an libraries which is needed in an package you can use in RHEL/CentOS environments

up2date --whatprovides=lib.so.5.2

or

yum provides lib.so.5.2

This shows which packages provides that specific file. apt does not have this feature as far as I know.

In apt you have a few

In apt you have a few possibilities. You could search based on filenames:

apt-cache search libc.so

Or you can install packages based on filenames:

apt-get install /usr/bin/elinks

It is also possible to add targets (written in lua) that do something more specific for what you want.

But for that I need to understand how you use it :)

re: In apt you have a few

"But for that I need to understand how you use it :)"

blokje exactly addressed my beef with synaptics (and perhaps the apt backend for all I know).

There are times where I need to install something that is not available from a repository (at all or perhaps just not in the revision I need).

In doing so (by compiling or whatever) it is quite possible to run into a requirement for a specific library or library revision. With yum it is easy to determine the package that provides any given file.

e.g. yum provides lib.so.5.2

When I last tried apt/synaptics with pclinuxos (don't recall the revision but it a few years ago in the "big daddy" era - BTW don't ever quesiton package management on the pclos forums unless you want to be chewed a new one - illustrates why I no longer have interest in pclos) I was told that apt/synaptic didn't do that and that since I knew enough to be compiling my own software I should know enough to find that information in other ways (e.g. google).

Thats fine I suppose (though doesn't work at all if you're not in an internet connected position) but I find it annoying to have to turn to google or take the easy way and turn to my centos box to do "yum provides" to then fix my apt/synaptics box which cannot do that.

Or can it? I think that was blokje's question and it is certainly mine. That feature alone makes me a yum fan. The underlying RPM package manager affords that feature and yum supports it.

apt-cache search only

apt-cache search only searches in package descriptions.
To search in the files provided by a package, use:

apt-file search libc.so

[This is the case for apt on Debian and Ubuntu. I'm
assuming that apt-cache's behaviour is not changed in
apt-rpm]

apt-file?

you can use apt-file search lib.so.5.2 for that :]

Thank the Nameless!

Now, I'm usually a Gentoo Guy, but using CentOs @ work. All i can say is _thank you_. apt aint no emerge, but it blows the stones off of yum. Thanks!

I just want all the package

I just want all the package managers to be able to use all the format types, just like File Roller can use RAR, ZIP, BZIP2, etc. Once that happens, the package format wars will subside as they won't be tied to a particular distro, and peace and harmony and Linux packages for all distros will finally come. Then, user's aren't screwed if a program only offers a DEB or RPM package for download when they aren't using a system that understands it.

I know the subject is not

I know the subject is not very easy, but think about what you are saying for a whole minute and then please conclude that your ideal world would be worse than anything under the sun today.

Hint: a package is not just an archive

Dependencies?

Interesting article. Does apt-rpm work with the rpm database? What I am thinking about are dependencies when you are installing packages and such. I would be afraid to mix and match apt and yum if they were using separate structures for recording what is installed on the system.

Dependencies!

Of course apt-rpm works with RPM packages. In fact it was the first depsolver in the RPM world that did. Since 2000 or 2001 it was used in the Red Hat world (remember FreshRPMS ?) to download, install and manage dependencies on Red Hat systems. Yum is much newer and became the default, but in my personal opinion apt is much more robust, faster and more versatile.

You can have both apt and yum installed on the same system, although you have to manage the repositories separately if you plan to use both. I do it all the time, use apt for most of the things and use yum if I have to test something or provide support on CentOS mailinglists/forums.

Viva Red Carpet!

Wasn't that out around 98 or so?

I don't think so. I was using

I don't think so. I was using apt before red-carpet was released by Ximian.

I don't see...

...how something functionally simillar is going to provide any advantage. In my opinion:

1. RPM==DEB==back-end package manager.
2. YUM==APT-GET==front-end to package manager that provides dependency management using meta-data features of the back-end.
3. Package-Kit==Synaptic==GUI for the front-end which makes it simple to use features through a GUI.

Now, if you find a feature missing in Package-Kit or Yum that is present in apt-get, it should be trivially easy to log a feature-request through appropriate bugzilla systems and get it included.

To me, on Fedora/Red-Hat systems, yum has always been better integrated with the RPM-backend and therefore the choice is moot. The choice, if I were to use Debian, would of course also be moot - it would be apt-get.

YMMV.

Does apt-rpm / Synaptic allow broken dependencies

Some time ago I have tried to use Synaptic (together with apt-rpm) as graphical package manager; around the times gnorpm finally stopped working. I have abandoned it because it didn't allow to proceed when I had some dependency chain broken, and it _had_ to remain broken (some package was installed only to bring some older version of library, and it had broken deps).

Someone needs to put together

Someone needs to put together a comprehensive equivilents page for rpm/yum and dpkg/apt for those who only know one system and have to administer the other on occasion. I've seen simple charts that say apt-get install is equal to yum install etc.. but what I want is a long list of equivalents between rpm and apt so that when I need to get a list of files in a certain package I can look for rpm -ql on the list and it will tell me the equivalent in APT/deb.. That would be handy.

Grant

Keep up the good work

Please keep up the good work. I personally use apt on all our servers and it works perfect.
I prefer aptitude over synaptic for better performance on remote managed sites. Creating an rpm for aptitude without your work on apt would probably freak me out - so keep up the good work.

Henry

managing *.list files

I'm still looking for a primer on managing the various .list files in /etc/apt/sources.list.d/ - I had an os.list that was kind of old, and things were 404ing for my RHEL4 system (that weren't when I set it up originally). I did an apt-get upgrade (with source info from apt.sw.be) and got told of an os.list.rpmnew, which had newer links to mirror.centos.org. I'm in the middle of another update/upgrade now, with the apt.sw.be commented out, and the entries for centos.org's os/, updates/, and extras/ enabled. (and golly, what's "fasttrack/"?)

Is that what I really want? Should I leave apt.sw.be in there too?

Something that presented this in an FAQ or other conventional wisdom would be great!

apt lover

I use ubuntu [debian] by choice because I only install what I need on a server most likely NEVER even an GUI. However apt [aptitude] quickly become one of your main tools

as an good sample install Centos, upgrade it then install apt as above and execute
apt-get --fix-broken install

You will be amased how many "broken" dependents are ther left by yum and others, aditionally it installs the perl stuffs also :) hmm....

synaptic install error

centos 5.4 x86_64

os.list:
### CENTOS ONLY
repomd http://mirror.centos.org/ centos/$(VERSION)/os/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/updates/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/extras/$(ARCH)
repomd http://mirror.centos.org centos/$(VERSION)/fasttrack/$(ARCH)

rpmforge.list:
repomd http://apt.sw.be redhat/el$(VERSION)/en/$(ARCH)/dag

THE RESULT/PROBLEM:

# apt-get install synaptic
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or that some of the repositories
in use are in an inconsistent state at the moment.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
synaptic: PreDepends: scrollkeeper but it is not installable
E: Broken packages

yum install apt still says

yum install apt still says Nothing to do

apt for centOS6

I searched the website
http://packages.sw.be/apt
There are no packages there for CentOS6. Today is July 12, 2013.

-sarah

Correct, apt no longer builds

Correct, apt no longer builds for RHEL6/CentOS6. Yum is now the default package manager.

Post new comment

Please refrain from adding URLs to unrelated or commercial websites. This site is moderated and comments with inappropriate links are rejected. Thank you for your understanding.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options