Working with apt-get, apt-cache and aptitude

Discussion in 'all things UNIX' started by Mrkvonic, Jul 15, 2009.

Thread Status:
Not open for further replies.
  1. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,223
    Hi all,

    Today, I would like to teach you about package management in Linux: we have an article introducing the powerful APT package management utility used mainly in Debian-based Linux distributions, but also some others. We'll cover aptitude, apt-get, apt-cache and other useful tools.

    Have fun:

    http://www.dedoimedo.com/computers/aptitude.html


    Regards,
    Mrk
     
  2. lodore

    lodore Registered Member

    Joined:
    Jun 22, 2006
    Posts:
    9,065
    very nice.
    I did wonder about aptitude versis apt-get and now i know.

    Btw kubuntu uses kpackagekit now.

    I could never get gdebi to work in debian.
    when i tryed to install an local opera.deb file using gbebi it messed up and told me to run synaptec to sort out the issue and i couldnt do any other package management until i did.
    once that was sorted i just added the opera deb repo using commandline and then installed using apt-get.
    I may try out some of the commands in your article in my debian squeeze virtual machine.
    any chance of a yum article if you have time?
     
    Last edited: Jul 15, 2009
  3. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,713
    Location:
    George, S.Africa
    This is very useful. Several commands I didn't know about, like adding the -s
    flag for simulation. Thank you !
    As regards the --purge flag, as far as I know it will remove the installed package
    and the associated config files, but will not remove dependencies. To remove
    the package plus the dependencies and (I think??) the config files,
    apt-get autoremove packagename should be used as mentioned in your tutorial. In my
    limited experience the config files are often not removed,
    even when using --purge and autoremove, and I need to manually delete them.

    I have also come across this one : aptitude clean --purge-unused (to find unneeded dependencies.)
     
  4. tsec

    tsec Registered Member

    Joined:
    Nov 18, 2008
    Posts:
    181
    Thanks heaps for this, mrk :)

    I have used apt-get so many times I have lost count,
    but I have never really thought about what was happening,
    or other functionality that might be available.

    Until now ;)

    Cheers
     
  5. tlu

    tlu Guest

    Mrk,

    very good - as usual :)

    Two remarks:
    • I think you should add a warning that apt-get and aptitude should NOT be used at the same time or alternatively. Both use different databases in order to control dependencies. If you switch from apt-get to aptitude you should use the option keep-all - otherwise aptitude might deinstall many packages that it thinks are no longer necessary. On the other hand, it's not possible to synchronize the apt-get database with the aptitude one. I've heard that in some cases using both package managers leaded to corrupted databases. Thus one should decide which one to use and stick to it.
      Having said that, there are people who think that aptitude is the better choice. And isn't aptitude still the recommended package manager for Debian?
    • As lodore already mentioned, Kubuntu now uses kpackagekit. Adept is no longer developed AFAIK.
     
  6. Pedro

    Pedro Registered Member

    Joined:
    Nov 2, 2006
    Posts:
    3,502
    I agree with tlu, and yes aptitude is the recommended option.

    I still use apt-get because of your first point. and only started using it because it's about the only example we get to read in tutorials. In time, i joined that party :doubt:
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.