This post is an old article I once posted on ubuntu forums – I’m getting it here for my own archival.
What is aptitude?
Aptitude is a package manager for Debian and Debian based systems (similar to say, synaptic).
Why should you use aptitude over synaptic/apt-get?
The million dollar reason: it remembers dependencies downloaded to install a particular package and removes them automatically when you remove that package. Synaptic only gives you the history log, and apt-get not even that.
I install wmaker using synaptic, it installs libwraster along with it.
I purge wmaker out using synaptic, it leaves libwraster. I have to manually search for it and uninstall.
Now this may not seem a big deal, but imagine if wmaker had 20 dependencies.
On the other hand:
I install wmaker using aptitude, it installs libwraster with it.
I purge wmaker out using aptitude, it figures out libwraster isn’t needed anymore, and gets rid of that too.
Awesome, isn’t it? 🙂
But I held back from using this rather nifty tool because I didn’t want to learn how to use it. Now I can use it, at least to do simple tasks. So I thought I would share that knowledge.
aptitude can run in two modes:
- command line mode
I will not write about this, other than to say the commands stay like apt-get .. which means you get aptitude power with apt-get commands.
sudo aptitude install wmaker
sudo aptitude update
sudo aptitude upgradeNote: to do a default upgrade, use the commandline above. Pressing U in the gui seems to do a smart upgrade, and that isn’t something I always want.
- gui mode
You start this with: sudo aptitude
f10 : pulls down the menu
Note: it seems f10 pulls down the gnome-terminal menu. If you want to use f10, then you may need to turn off the gnome-terminal menu for the session. Alternately, just click on the aptitude menu, the mouse click works.
q : quit
u : updates package lists
/ : search for a package (firefox style)
n : find next
f : forget new packages, useful if you have a habit of peeking into new packages available after each update.Once you have found your package,
enter: to see information about that package
+ : mark a package for install or upgrade
– (minus) : mark a package for removal
_ (underscore): mark a package for purging
: : cancel any action on the selected packageU: to mark all upgradable packages (for upgrade :))
Once you have marked your changes,
g : apply those changes.
If you are in a screen which says displays package information, and you want to go back to the earlier screen, press f6 or q.
Once you press g, all the changes get listed. You can modify any of the changes, and then press g again to finally apply marked changes. I’ll keep adding to this HOWTO as I learn new things, and if you have any suggestions/tips/corrections please add to this thread .. I’ll update this post.