List of recently installed apt packages

6

1

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.

edit:

@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.

gcb

Posted 2015-01-29T08:53:46.130

Reputation: 3 392

2

The same question is resolved in AskUbuntu: http://askubuntu.com/questions/21657/show-apt-get-installed-packages-history-via-commandline

– jmonrio – 2015-01-29T09:06:56.583

Answers

6

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

duDE

Posted 2015-01-29T08:53:46.130

Reputation: 14 097

1this still shows all the installed dependencies, but i think this is the best that we can get. – gcb – 2015-02-01T01:41:41.223

1

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!

agtoever

Posted 2015-01-29T08:53:46.130

Reputation: 5 490

but as i said, history alone is not enough because some packages where selected in the graphic mode of apitude – gcb – 2015-01-30T22:59:19.337