There are 3-4 main things that aptitude does and is good at -

a. Upgrading packages - $ sudo aptitude safe-upgrade -y

b. Installing packages - $ sudo aptitude install $PACKAGENAME

c. purging (removing package + configuration files - $ sudo aptitude purge $PACKAGENAME

Now all of aptitude exploits are written in /var/log/aptitude and its revolving gunzipped archives

┌─[shirish@debian] - [/var/log] - [10030]
└─[$] cat apt                                                                                                                         
apache2/       apt/           aptitude       aptitude.1.gz  aptitude.2.gz  aptitude.3.gz  aptitude.4.gz  aptitude.5.gz  aptitude.6.gz

Now I know that the data I'm looking for is probably in those aptitude logs. How do I tell aptitude to only show those packages which I installed anew rather than those installed as part of upgrades, any ideas anybody ?

  • 1
    What does “installed as part of bicycle” mean? – Gilles 'SO- stop being evil' Feb 21 '17 at 23:54
  • @Giles - oops, gypsies at work, have fixed it now, thank you. – shirish Feb 22 '17 at 1:20
  • Gypsies at work? – schaiba Feb 22 '17 at 9:00
  • As far as i know, apt marks installed packages by user as manual. running apt list |grep installed |grep manual (mind not to provide an argument on apt list) should return all installed packages marked as "manual" and should give a close indication on what are you looking to. – George Vasiliou Feb 22 '17 at 9:54
  • nope that doesn't work I get [$] apt list | grep installed | grep manual [16:47:22] WARNING: apt does not have a stable CLI interface. Use with caution in scripts. live-manual-pdf/testing,testing,unstable,unstable,now 2:20151217.1 all [installed] – shirish Feb 22 '17 at 14:02

To list all packages installed through aptitude , you should run the following command:

cat /var/log/aptitude* | grep INSTALL]


The follwing command will display the installed package with their dependencies:

cat /var/log/aptitude* | grep INSTALL

To exclude the DEPENDENCIES you can add the ] or something like:

cat /var/log/aptitude* | grep INSTALL | egrep -v DEPENDENCIES

There is an example emacs:

[INSTALL, DEPENDENCIES] emacs24-bin-common:amd64
[INSTALL, DEPENDENCIES] emacs24-common:amd64
[INSTALL, DEPENDENCIES] libm17n-0:amd64
[INSTALL] emacs:amd64
  • I did get a few but not sure that's the whole story though because the results are very few. Also I wonder if this is enough cat /var/log/aptitude* | grep INSTALL no need for the extra ] get the same results. For some reason I don't think all the aptitude gunzipped archives are being parsed otherwise would surely have got more results, is there a way to figure out from where the result came, which aptitude* for e.g. ? – shirish Feb 22 '17 at 14:05
  • the cat /var/log/aptitude* | grep INSTALL will display the installed package with its dependiencies , the ] to excluse the dependencies – GAD3R Feb 22 '17 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.