≡ Menu

How to find out when Debian or Ubuntu package installed or updated

How do I find and list installed Debian or Ubuntu Linux packages date? How can I see when packages got updated on my systems?

Debian or Ubuntu Linux log package status changes and actions to a file. The default is /var/log/dpkg.log file. This file has log message in the following format:

Log messages are of the form `YYYY-MM-DD HH:MM:SS status state pkg installed-version’ for status change updates; `YYYY-MM-DD HH:MM:SS action pkg installed-version available-version’ for actions where action is one of install, upgrade, remove, purge; and `YYYY-MM-DD HH:MM:SS conffile filename decision’ for conffile changes where decision is either install or keep.

List packages by installation date

Simply type the following command to see the last packages info:
# tail -f /var/log/dpkg.log
Sample outputs:

2016-01-14 13:20:50 status installed man-db:amd64 2.6.7.1-1ubuntu1
2016-01-14 13:20:50 trigproc libc-bin:amd64 2.19-0ubuntu6.6 
2016-01-14 13:20:50 status half-configured libc-bin:amd64 2.19-0ubuntu6.6
2016-01-14 13:20:50 status installed libc-bin:amd64 2.19-0ubuntu6.6
2016-01-14 13:20:50 trigproc libglib2.0-0:amd64 2.40.2-0ubuntu1 
2016-01-14 13:20:50 status half-configured libglib2.0-0:amd64 2.40.2-0ubuntu1
2016-01-14 13:20:51 status installed libglib2.0-0:amd64 2.40.2-0ubuntu1
2016-01-14 13:20:51 trigproc gconf2:amd64 3.2.6-0ubuntu2 
2016-01-14 13:20:51 status half-configured gconf2:amd64 3.2.6-0ubuntu2
2016-01-14 13:20:51 status installed gconf2:amd64 3.2.6-0ubuntu2

To view all info, enter:
# less /var/log/dpkg.log
# more /var/log/dpkg.log

Fig.01: Ubuntu Linux List Package Install Upgrade Date and Time

Fig.01: Ubuntu Linux List Package Install Upgrade Date and Time


/var/log/dpkg.log may be rotated or compressed using logrotate tool. To view list of all files, enter:
# ls -l /var/log/dpkg.log*
Sample outputs:

-rw-r--r-- 1 root root  9252 Jan 14 13:27 /var/log/dpkg.log
-rw-r--r-- 1 root root 11658 Dec 16 03:53 /var/log/dpkg.log.1
-rw-r--r-- 1 root root  1563 Mar 22  2015 /var/log/dpkg.log.10.gz
-rw-r--r-- 1 root root 14218 Feb 17  2015 /var/log/dpkg.log.11.gz
-rw-r--r-- 1 root root   962 Nov 27 18:14 /var/log/dpkg.log.2.gz
-rw-r--r-- 1 root root  2008 Oct 30 14:09 /var/log/dpkg.log.3.gz
-rw-r--r-- 1 root root  2490 Sep 30 14:01 /var/log/dpkg.log.4.gz
-rw-r--r-- 1 root root  1875 Aug 17 05:09 /var/log/dpkg.log.5.gz
-rw-r--r-- 1 root root   847 Jul 22 12:31 /var/log/dpkg.log.6.gz
-rw-r--r-- 1 root root  1367 Jun 25  2015 /var/log/dpkg.log.7.gz
-rw-r--r-- 1 root root  1460 May 31  2015 /var/log/dpkg.log.8.gz
-rw-r--r-- 1 root root  5504 Apr 29  2015 /var/log/dpkg.log.9.gz

Use the zgrep or zmore command to search or view gzipd log files:
# zmore /var/log/dpkg.log.5.gz
# zless /var/log/dpkg.log.5.gz
# zgrep 'remove' /var/log/dpkg.log.5.gz

See package installation date and time

# grep installed /var/log/dpkg.log
Sample outputs:

2016-01-05 14:32:53 status half-installed libidn11:amd64 1.28-1ubuntu2
2016-01-05 14:32:53 status half-installed wget:amd64 1.15-1ubuntu1.14.04.1
2016-01-05 14:32:53 status installed libidn11:amd64 1.28-1ubuntu2
2016-01-05 14:32:53 status installed wget:amd64 1.15-1ubuntu1.14.04.1
2016-01-05 14:32:53 status installed libc-bin:amd64 2.19-0ubuntu6.6
2016-01-06 14:03:27 status half-installed libpng12-0:amd64 1.2.50-1ubuntu2.14.04.1
2016-01-06 14:03:27 status half-installed libpng12-0:amd64 1.2.50-1ubuntu2.14.04.1
2016-01-06 14:03:28 status installed libpng12-0:amd64 1.2.50-1ubuntu2.14.04.2
2016-01-06 14:03:28 status installed libc-bin:amd64 2.19-0ubuntu6.6
2016-01-10 13:41:54 status half-installed libgnutls-openssl27:amd64 2.12.23-12ubuntu2.3
2016-01-10 13:41:54 status half-installed libgnutls-openssl27:amd64 2.12.23-12ubuntu2.3
2016-01-10 13:41:54 status half-installed libgnutls26:amd64 2.12.23-12ubuntu2.3
2016-01-10 13:41:54 status half-installed libgnutls26:amd64 2.12.23-12ubuntu2.3
2016-01-10 13:41:54 status installed libgnutls26:amd64 2.12.23-12ubuntu2.4
2016-01-10 13:41:54 status installed libgnutls-openssl27:amd64 2.12.23-12ubuntu2.4
2016-01-10 13:41:54 status installed libc-bin:amd64 2.19-0ubuntu6.6
2016-01-14 13:27:15 status half-installed gcc-4.9-base:amd64 4.9.1-0ubuntu1
2016-01-14 13:27:15 status half-installed gcc-4.9-base:amd64 4.9.1-0ubuntu1
2016-01-14 13:27:15 status installed gcc-4.9-base:amd64 4.9.3-0ubuntu4
2016-01-14 13:27:15 status half-installed libgcc1:amd64 1:4.9.1-0ubuntu1
2016-01-14 13:27:15 status half-installed libgcc1:amd64 1:4.9.1-0ubuntu1
2016-01-14 13:27:15 status installed libgcc1:amd64 1:4.9.3-0ubuntu4
2016-01-14 13:27:15 status installed libc-bin:amd64 2.19-0ubuntu6.6
2016-01-14 13:27:15 status half-installed isc-dhcp-client:amd64 4.2.4-7ubuntu12.3
2016-01-14 13:27:15 status half-installed isc-dhcp-client:amd64 4.2.4-7ubuntu12.3
2016-01-14 13:27:15 status half-installed isc-dhcp-common:amd64 4.2.4-7ubuntu12.3
2016-01-14 13:27:15 status half-installed isc-dhcp-common:amd64 4.2.4-7ubuntu12.3
2016-01-14 13:27:15 status installed isc-dhcp-common:amd64 4.2.4-7ubuntu12.4
2016-01-14 13:27:16 status installed isc-dhcp-client:amd64 4.2.4-7ubuntu12.4

To look into gzipd log file, enter:
# zgrep installed /var/log/dpkg.log.3.gz

List package upgrade date and time

# grep upgrade /var/log/dpkg.log
# grep upgrade /var/log/dpkg.log.1
#***[ Look into gzipd dpkg.log.2.gz file using zgrep ]***#
# zgrep upgrade /var/log/dpkg.log.2.gz

Show package removal (deleted) date and time

# grep remove /var/log/dpkg.log
# grep remove /var/log/dpkg.log.1
#***[ Look into gzipd dpkg.log.2.gz file using zgrep ]***#
# zgrep remove /var/log/dpkg.log.2.gz

Say hello to /var/log/apt/history.log file

The /var/log/apt/history.log file has same info too. To view, enter:
# tail -f /var/log/apt/history.log
# more /var/log/apt/history.log
# less /var/log/apt/history.log
# grep -A4 -B4 'yyyy-mm-dd' /var/log/apt/history.log
# grep -A4 '2016-01-14' /var/log/apt/history.log

Start-Date: 2016-01-14  13:18:16
Commandline: apt-get upgrade
Upgrade: isc-dhcp-common:amd64 (4.2.4-7ubuntu12.3, 4.2.4-7ubuntu12.4), isc-dhcp-client:amd64 (4.2.4-7ubuntu12.3, 4.2.4-7ubuntu12.4)
End-Date: 2016-01-14  13:18:24
Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:



{ 0 comments… add one }

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , ,