Saturday, August 15, 2009

aptitude vs apt-get

It has been more than a year that I am using ubuntu(hardy). I wanted to upgrade to jaunty(ubuntu 9.04) when I came across 'aptitude' which has lot of advantages over 'apt' that we commonly use. Being a Debian user, I am well aquainted with Advanced Packaging Tool(apt) but the difference between aptitude and apt was not there in my cognizance.
As we know for a Debian based distro, apt-get is the way to install ,remove update package lists and even upgrade a software.( man apt-get gives the details).
But if you want more ,then there are 15 more tools at hand.
apt-cache,apt-listbugs,apt-listchanges,apt-rdepends,deborphaned,debfoster,dselect,dpkg,apt-cdrom, apt-config, apt-extracttemplates, apt-ftparchive, apt-key, apt-mark and apt-sortpkgs.(google to know more about their usage)
But isn't it too stupefying to memorize the tools??? Well, it is indeed for me so I explored all about aptitude...here is what I learnt.
The advantage of aptitude over apt is that:
'apt-get remove' removes the packages but leaves the orphaned dependencies on the system; so this is a failure. Although to my knowledge ,'apt-get autoremove' is able to handle this problem but aptitude can find us the best solution; 'aptitude' automatically removes the dependencies when a package is removed if no other package is dependent on those dependencies.
Hence, 'aptitude' is the superior tool and the best way to install,remove,upgrade packages for the system. It is one that can help us accomplish a lot with less efforts.
Here is what I found all about 'aptitude':
  • aptitude: Running it with no arguments brings up a beautiful interface to search, navigate, install, update and otherwise administer packages.
  • aptitude install: Installing software for your system, installing needed dependencies as well.
  • aptitude remove: Removing packages as well as orphaned dependencies.
  • aptitude purge: Removing packages and orphaned dependencies as well as any configuration files left behind.
  • aptitude search: Search for packages in the local apt package lists.
  • aptitude update: Update the local packages lists.
  • aptitude upgrade: Upgrade any installed packages that have been updated.
  • aptitude clean: Delete any downloaded files necessary for installing the software on your system.
  • aptitude dist-upgrade: Upgrade packages, even if it means uninstalling certain packages.
  • aptitude show: Show details about a package name.
  • aptitude autoclean: Delete only out-of-date packages, but keep current ones.
  • aptitude hold:Fix a package at it’s current version, and don’t update it
( Type 'man aptitude' in terminal to know more)

More utilities of aptitude that I found are that when searching for a package using aptitude, the results are sorted alphabetically and justified in column width format and also the ones that are already installed in the system are notified unlike when doing with 'apt-cache'.
But here is something very important to note,we cannot install a package with apt-get or Synaptic and then remove dependencies by using aptitude and secondly for aptitude to work properly we must first do an update and then an install a package. With these two points in mind , aptitude works easy and great.
So, I suggest my novice friends who are new to a debian system and complacent with apt-get , to start using aptitude instead of apt-get ...It works better than apt-get in every sense. ( This blog is not meant for the people who are already aware of the utility of 'aptitude' and are experts.)
Suggestions and comments are welcome from the experts on this...

7 comments:

Varsha Jaikumar said...

I am not an expert, but I am still commenting. :P

This post of yours really is a result of skillful research and usage of different aspects of the hot topic that are new to users who have just stepped into this field of exploring the vast and diversified world of Linux. Do keep writing and keep us informed about whatever you know and whatever you learn, even in the near future. :)

All the best.

nik.agarwal said...

Good work.Post is very informative and a very good comparision .Instead it should be headed as 'aptitude vs apt-get' .Keep it up.keep blogging and don't let any myths revolve around you!!

Unknown said...

I have been using ubuntu/debian for more than 2 years now - had taken it for granted that 'apt-get' and 'aptitude' are one and the same!!

Simple but enlightening post!

Priyanka Chatterjee said...

unni ..you must be more experienced than me as you are in the industry and I am yet to make an entry there...but whatever I blogged is a consequence of a problem I faced with apt-get...the result is that I got to know about the utility of aptitude

Eric said...

I'd like to mention aptitude keep-all , if you switch from apt-get to aptitude, see http://linux.koolsolutions.com/2009/02/20/howto-switching-from-apt-get-to-aptitude/

Sourav Mukhopadhyay said...

It's really exiting to read your posts.

Ubuntu is a great Opensource Product. Myself a promoter of opensource technologies.But the market is still a Microsoft/ Apple 's market.

WHY?

Priyanka Chatterjee said...

@Sourav: Market share is still occupied or will be occupied by Microsoft/Apple because Microsoft products are much more user-friendly and on the other hand open source products are meant primarily for developers or advanced users and not for naive users..