Does anyone know if there's an easy way to find a list of packages installed, sorted by date, when using aptitude
(or apt-get
)?
I installed a bunch of packages to try something new, but it didn't work out. I'd like to remove all of these packages, to get back some disk space.
I've tried just looking at the list of .deb files downloaded, but that seems like a rather backwards way of doing it (although it did work).
Unfortunately, dpkg (the package handler aptitude works on top of) does not specifically save the install date of packages, although there's thoughts of adding it. However, the install date can be found by looking at the date stamp of files written to the directory
/var/lib/dpkg/info
.By default,
aptitude
writes to a log file/var/log/aptitude
. It produces output like this:This shows the exact date and packages that aptitude installed. To configure this (in
/etc/apt/apt.conf
or in a separate file in/etc/apt/apt.conf.d/
), follow the Configuration file reference in aptitude manual (also available from "Help > User's Manual" in the menu):There is a simple way to see all packages installation date. Just execute:
As a result you will get a list of all installed packages with exact date and time.
Thanks for comments which lead me to that solution.
I found this one here on the web. It creates a history of dpkg out of the dpkg log file.
It looks very simple.
Source
EDIT
I tried this script on Ubuntu 8.10 Server and it works very well. Could you provide some information, how you solved your problem?
Use the dpkg logs
OR if you don't have
locate
Use
sort
to ensure proper time based orderingUse
tac
(reversecat
)*, head e.g to get latest 4 entriese.g For the last command, I get:
You can also track down your previous actions by checking /var/log/apt/term.log, and older files term.log.1.gz etc.). It has timestamps and complete log from messages during install.
There is indeed an 'official'
pkginstall.sh
script that can do this. Follow the instructions in the official documentation. Briefly, download the script from the above link, make sure it is executable and then run with:~/pkginstalls.sh
This will create
pkginstalls.txt
file in your home directory containing all the installed packages sorted by date.BTW, this is the content of the script:
[ANSWERING THE ACTUAL QUESTION], Yes, there is an EASY way to look up packages installed on a particular date, even if it was done inside of terminal using apt-get.
If you install the Synaptic Package Manager, which is freely installable from the Ubuntu Software Center, you need only open its FILE menu and choose the "History" option. There you will find an accounting of all added and removed application packages, organized by date, regardless of how they came to be installed or removed.