About Me

header ads

[GUIDE] Here's how to see the history of packages installed, updated or removed on Ubuntu, Debian or Mint

file-history-696x392 (1).png

In this article we will see how to find out all the packages installed, updated or removed from your system. The guide, which is based on the use of the command line, is valid for Ubuntu , Linux Mint and Debian (and probably for most derivatives).

The goal is to access the history of your system, which is the list of DEB packages you have installed/updated/removed, including the date you did it. To do this on Debian, Ubuntu and Linux Mint you can read the dpkg.log file (dpkg is the low-level architecture for package management, installation and removal). You find it in the path /var/log/dpkg.log. You can use the command grep to parse the file and then go to view only the removed packages or those installed or updated ones, based on your needs.

This method works for packages DEB whatever way you installed them: graphical tools such as Synaptic, GNOME Software Update Manager, or a command line tool such as apt, apt-get, aptitude or dpkg. But it does not work for other packages like Flatpak or Snap, or for software installed from sources.

Open the terminal and give:
grep "install " /var/log/dpkg.log
This is the result:
$ grep "install " /var/log/dpkg.log
2019-01-08 13:22:15 install automathemely:all <none> 1.3
2019-01-08 13:22:29 install python3-astral:all <none> 1.6.1-1
2019-01-08 13:22:29 install python3-tzlocal:all <none> 1.5.1-1
2019-01-08 13:22:29 install python3-schedule:all <none> 0.3.2-1
...
2019-01-09 17:19:49 install libwebkit2-sharp-4.0-cil:amd64 <none> 2.10.9+git20160917-1.1
2019-01-09 17:19:49 install sparkleshare:all <none> 3.28-1
2019-01-15 15:58:20 install ffsend:amd64 <none> 0.1.2
Similarly you can give
grep "upgrade " /var/log/dpkg.lo
for a list of updated packages.

Or
grep "remove " /var/log/dpkg.log
for the list of packages removed.

/var/log/dpkg.log contains packages installed, updated and removed for the current month. For the previous month, read the file /var/log/dpkg.log.1

For example, dates:
grep "install " /var/log/dpkg.log.1
Do you want to go further back? Use zgrep in place of grep and read /var/log/dpkg.log.2.gz, /var/log/dpkg.log.3.gz, /var/log/dpkg.log.4.gz and so on.

Example:
zgrep "upgrade " /var/log/dpkg.log.2.gz
Alternative roads
There are alternative methods to achieve the same goal but, as they say in my part, "work". For example Synaptic Package Manager (File -> History) can only show you a history of the packages installed, updated, or removed by Synaptic same (and not those updated/installed/removed by apt, apt-get, dpkg, Software Updater, etc). Similarly, the log file /var/log/apt/history.log shows only the actions performed using apt/apt-get.

Post a Comment

0 Comments