Prefer aptitude over apt-get (for dist-upgrades) (page 181)
More...Reported on: 2005-07-18
In chapter 5. The Debian package management system on page 181:
Chapter 5.4 introduces APT, and the Debian way of installing, removing, and upgrading packages. The traditional front-end to APT, apt-get, may in the future be replaced by aptitude, which implements most of the command-line options of apt-get (see p. 195f) and is thus a viable drop-in replacement. The sarge release notes recommend using aptitude instead of apt-get, as it "makes safer decisions about package installations than running apt-get directly."
Discussion
A system upgrade from woody to sarge would thus look like this (the -P option forces aptitude to always prompt for confirmation, which is a good thing on something as important as a system upgrade):
~# aptitude -P dist-upgrade [...] The following NEW packages will be automatically installed: coreutils cpp-3.3 debconf-i18n dselect e2fslibs g++-3.3 gcc-3.3 [...] [...] The following packages will be upgraded: apt apt-utils aptitude base-files base-passwd bash binutils bsdmainutils [...] 66 packages upgraded, 35 newly installed, 1 to remove and 0 not upgraded. Need to get 50.7MB of archives. After unpacking 65.9MB will be used. Do you want to continue? [Y/n/e/d/v/action/?] y Writing extended state information... Done Get:1 http://debian.ethz.ch sarge/main libdb1-compat 2.1.3-7 [30.8kB] [...] Reading Package Lists... Done Building Dependency Tree Reading extended state information... Done
While this recommendation applies mainly to distribution upgrades (dist-upgrade), aptitude's improved handling of dependencies may cause it to replace the antiquated apt-get interface in the long run. As aptitude is reasonably syntax-compatible to apt-get on the command line, it is trivially possible to simply use it instead, and almost all of APT's concepts will continue to apply.