I just spent an hour trying to solve dependencies to build freeCAD from their slightly outdated Wiki.

Is there a way to get the packages I installed in the last hour or day with apt-get or aptitude?

My first try was ls -t /var/apt/cache/archive but that list packages with weird dates. for example, one I'm sure Installed just now, python2.7-dev, is listed as "Mar 17 2014". The only thing listed as today are a few security updates I did this morning. And there are dirs there marked from 2006. I didn't even have that install that long ago.

I can't use command line history either because I used a mix of apt-get install and aptitude. also I had several terminals and history got screwy after a while.


@jmonrio pointed to an excellent answer, but that gives me a ton of packages when i only installed a handful. it does not differentiate from what i asked to be installed from what was installed as part of the dependency chain.

Do I have any hope of getting the minimum install line for that history? i.e. without the automatically included ones.


2 Answers 2


Take a look at this answer:

Command to list recently installed packages that were installed via any method (apt-get, Software Center et al.):

grep " install " /var/log/dpkg.log

You could run this command to list only the recently installed package names,

awk '$3~/^install$/ {print $4;}' /var/log/dpkg.log
  • 1
    this still shows all the installed dependencies, but i think this is the best that we can get.
    – gcb
    Feb 1, 2015 at 1:41

If you use sudo to start apt or aptitude, all commands are written to /var/log/auth.log. So a grep apt /var/log/auth.log should give you the commands. In my case (Debian), grep '/usr/bin/apt' auth.log* | awk '{print $15}' returned all apt/aptitude commands neatly. Adjust accordingly. Good luck!

  • but as i said, history alone is not enough because some packages where selected in the graphic mode of apitude
    – gcb
    Jan 30, 2015 at 22:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .