Four Ways to Install .. Here’s Why Aptitude Is Best?



ubuntu karmic koala

As we install many packages from a clean install, let's compare the 4 methods for this and software removal, 2 of which are new, included by default.

The first two methods, apt-get and aptitude, are used in conjunction with the terminal. The other two, the Synaptic Package Manager and Karmic's new Software Center are the GUI (graphical user interface) equivalents.

To delve deeper ..

Setup Unmanaged VPS (4 Noobs!) ... with vpsBible
Secure WordPress. Properly. ... with wpCop, the platform's dedicated security website
Olly 'the_guv' Connelly's vpsBible.com site and 'WordPress 3 Ultimate Security' book.

apt-get An installation/removal method. As well as installing/removing packages, it installs any dependency files, such as relevant libraries, and removes conflicting software.

aptitude Ditto apt-get. Except. When you remove with apt-get, it doesn't remember, and so doesn't remove, any dependency files. Aptitude remembers your installations, so when you remove something, it removes the dependencies too. There is a proviso to this advantage, and that is that any required dependencies are known by your machine prior to installation. To be safe, before installing with aptitude, run a quick “update”.

.. So, the long and short of that is, of apt-get and aptitude, I only ever use aptitude which, BTW, is installed by default with Karmic Koala (it had to be manually installed with prior versions). If anyone can tell me why I should ever use apt-get, I'm all ears. There are those that say you should use either one or the other. Hmmn, just use aptitude then!

Synaptic The GUI equivalent of aptitude or apt-get, and includes other useful tools like the repository manager. I don't use it in this guide for installations. Why? Other than because it does the same thing, here are the steps involved:-

  • Open System > Administration > Synaptic Package Manager
  • Search for the program or package ***
  • Check the box Mark for Installation
  • Click the Apply button

*** This can be very handy, particularly with the resulting package description.

Software Center Essentially the now-deprecated Add/Remove procedure rewrapped for user-friendliness. It's a method not dissimilar to Synaptic. Again, it takes too long. Then again, it's pretty, and I for one like pretty .. but generally I prefer speed!

Using aptitude, on the other hand:-

  • Open Applications > Services > Terminal (if it isn't already open)
  • Type sudo aptitude install [package] or sudo aptitude remove [package]

.. and this can be simplified even further, with a one-time edit to the bashrc file. Read the next section Terminal Alias Shortcuts with bashrc for more on this (and lots lots lots more) ..

.. but, basically, all I ever type is install [some package] or remove [another]. In this guide though, I'll use the full syntax except in the bashrc section.

Result: As well as its great dependency file memory feature, aptitude = more time down the pub.

Linux. Built for speed .. and beer drinkers.

7


About the Author:

Olly Connelly (yeah, that's me) blogs at guvnr.com, polices WordPress security at wpCop.com and helps noobs build web servers at vpsBible.com, so if you've got sleeping problems you know where to come.

Discussion

  1. the_guv  April 1, 2010

    @Jason .. google this “ubuntu network troubleshoot guide” .. can’t remember the uri but there’s an excellent doc that will help and it will be in the top search results for that keyword.

    hope that helps

  2. Jason  March 30, 2010

    hiya mate, trying to use synaptic manager to install applications but somehow the download speed is extremely slooooowwwwww… download speed only a few KB/s and most of the installation takes over a day. This is not the same case when i use windows on this same machine. Laptop is Duo Core with 3GB RAM and the download speed in windows could reach 800Kbps. Any idea why? cheers

  3. the_guv  February 22, 2010

    @village .. tx for this .. have been searching for a definitive answer for a long time with no luck .. there are various threads on ubuntuforums about this, with none that I have seen clarifying the position. therefore I personally continue to use aptitude, to be safe .. but tell me, if they are the same now (I realise you are not quite saying this, but are they?) then why have both?

    appreciate your feedback. any official link about this would be most appreciated.

  4. village  February 21, 2010

    since version 0.6.44.2ubuntu1 (3 Jul 2006) apt-get records which packages it installed automatically (by dependencies) and which ones it installed “by command”.
    So you don’t have the aptitude/apt “problems” any longer.

    Source: /usr/share/doc/apt/changelog.gz

  5. the_guv  December 7, 2009

    @Ben .. tx for tips

  6. Ben  December 3, 2009

    Double posting now – just some edits for your .bashrc
    alias install=’sudo aptitude install’
    alias remove=’sudo aptitude remove’
    alias autoremove=’sudo apt-get autoclean && sudo apt-get autoremove && sudo apt-get clean && sudo apt-get remove && orphand’
    alias repo=’sudo add-apt-repository’
    alias update=’sudo aptitude update && sudo aptitude safe-upgrade’

    I guess you could say I prefer aptitude also 😉

  7. Ben  December 3, 2009

    No sign of Jig here? I’m getting into using both Jig, and sometimes I use apt-fast which is also very cool. Give them a whirl 😉

Add a Comment