How can I get a log of the updates I installed recently?
772
I want to get a log of the updates I installed in my Ubuntu 18.04 recently (say last month) using apt-get upgrade and apt-get update. Is there any way?
Another route is to examine /var/log/dpkg.log and its archives:
zgrep "2018-11.* status installed" /var/log/dpkg.log* | sort -t- -k2 -r
Notes:
This command will also include packages that were already installed on your system but updated in the month of November 2018. Change 2018-11 to whatever other period you wish to examine.
The history of the commands
apt
,apt-get
and the like is stored in the directory/var/log/apt
in the filehistory.log
:The file
history.log
is the current logfile. It gets rotated by thelogrotate
job in/etc/logrotate.d/apt
once a month and kept for 12 months:To view logs from previous months look into the
*.N.gz
files, e.g.:(No need to unzip them first,
zless
(andzgrep
) does this under the hood.)Another route is to examine
/var/log/dpkg.log
and its archives:Notes:
2018-11
to whatever other period you wish to examine.