This is a frequently asked question: “What package manager shall I use?”. And my answer is “the one that suits your needs”. In my case, I even use different package managers depending on what I’m trying to do.
APT vs dpkg, which one is the package manager?
In the Debian world, we’re usually thinking of APT-based software when we’re referring to a “package manager”. But in truth, the real package manager is dpkg. It’s the low-level tool that takes a .deb file and extracts its content on the disk, or that takes the name of a package to remove the associated files, etc.
APT is better known because it’s the part of the packaging infrastructure that matters to the user. APT makes collection of software available to the user and does the dirty work of downloading all the required packages and installing them by calling dpkg in the correct order to respect the dependencies.
But APT is not a simple program, it’s a library and several different APT frontends have been developed on top of that library. The most widely known is apt-get
since it’s the oldest one, and it’s provided by APT itself.
Graphical APT front-ends
update-manager is a simple frontend useful to install security updates and other trivial daily upgrades (if you’re using testing or sid). It’s the one that you get when you click in the desktop notification that tells you that updates are available. In cases, where the upgrade is too complicated for update-manager, it will suggest to run synaptic which is full featured package manager. You can browse the list on installed/available packages in numerous ways, you can mark packages for installation/upgrade/removal/purge and then run in one go all the recorded actions.
software-center aims to be an easy to use application installer, it will hide most of the packaging details and will only present installed/available applications (as defined by a .desktop file). It’s very user friendly and has been developed by Ubuntu.
Of the graphical front-ends, I use mainly synaptic and only when I’m reviewing what I have installed to trim the system down.
Console-based GUI APT front-ends
In this category, I’ll cite only aptitude. Run without parameter, it will start a powerful console-based GUI. Much like synaptic, you can have multiple views of the installed/available packages and mark packages for installation/upgrade/removal/purge before executing everything at once.
Command-line based package managers and APT front-ends
This is where the well known apt-get fits, but there are several other alternatives: aptitude, cupt, wajig. Wajig and cupt are special cases as they don’t use libapt: the former wraps several tools including apt-get, and the latter is a (partial) APT reimplementation (versions 1.x were in Perl, 2.x are now is C++).
You’re welcome to try them out and find out which one you prefer, but I have never felt the need to use something else than apt-get and aptitude.
apt-get or aptitude?
First I want to make it clear that you can use both and mix them without problems. It used to be annoying when apt-get did not track which packages were automatically installed while aptitude did, but now that both packages share this list, there’s no reason to avoid switching back and forth.
I would recommend apt-get for the big upgrades (i.e. dist-upgrade from one stable to the next) because it will always find quickly a relatively good solution while aptitude can find several convoluted solutions (or none) and it’s difficult to decide which one should be used.
On the opposite for regular upgrades in unstable (or testing), I would recommend “aptitude safe-upgrade
“. It does a better job than apt-get at keeping on hold packages which are temporarily broken due to some not yet finished changes while still installing new packages when required. With aptitude it’s also possible to tweak dynamically the suggested operations while apt-get doesn’t allow this. And aptitude’s command line is probably more consistent: with apt-get you have to switch between apt-get and apt-cache depending on the operation that you want to do, aptitude on the other hand does everything by itself.
Take some time to read their respective documentation and to try them.
Click here to subscribe to my free newsletter and get my monthly analysis on what’s going on in Debian and Ubuntu. Or just follow along via the RSS feed, Identi.ca, Twitter or Facebook.
Boris Dušek says
The link to software-center is missing the dash in the package name (softwarecenter instead of software-center).
Raphaël Hertzog says
Thanks, fixed.
Eugene V. Lyubimkin says
Raphaël, Cupt is not APT front-end.
Raphaël Hertzog says
Sorry for the mistake, I fixed the article.
cbx says
Just a feedback from my family : my daughter, a teenager using linux as her personal desktop OS, just loves Software Center : she looks for software she needs easily through this interface and can install what she found very easilly too.
Real life example of Software Center usage 🙂
Julian Andres Klode says
With cupt, you can specify on the command-line which packages should remain installed during the upgrade making it very useful if you have some packages you absolutely want to keep (such as one big meta package)
jidanni says
I use this combo every day
apt-get update && aptitude full-upgrade
As you can see, I use aptitude, but always its CLI and never its GUI, which older user me finds confusing.
jidanni says
I mix the two packages due to bug #563887: aptitude: update doesn’t alert user of the errors that apt-get update does. Else I would use pure aptitude.
Casper says
“but now that both packages share this list”
What does it mean? Since squeeze? Can mixing both aptitude and apt-get in lenny and earlier cause problems? Thanks in advance for clarification.
Raphaël Hertzog says
The feature is in APT since 0.7.0. Lenny and Squeeze are thus OK, earlier versions are not (i.e. installing packages with apt-get will not add the “automatically installed” flag to the dependencies that were automatically installed).
Selim Erdoğan says
I still use dselect. 🙂
Mathieu says
Simple as ABC: Linux people want casual users to go to linux and beat the crap outta Apple and Microsoft ? Casual users need Software Center and GUI. Time to stop being Linux/MacFags Compu-Hipster with code lines and everything… If not: PLEAAAAAAAAAAAASE, LEAVE CASUAL USERS TO THEIR F******** WINDOWS AND APPLE DEVICES. Casual users NEEDS GUI because they (we, I) have NOT followed any computing course EVER. They (we, I) like their TOOLS SIMPLE, as a TOOL IS SUPPOSED TO BE. Thank you, Linux world.