Whenever you apply an install/update/remove any package or packages Ubuntu log the changes happened to packages in its default file /var/log/dpkg.log. If you do listing to /var/log/ path (below is the command) you may find numbers of uncompressed and compressed dpkg.log files it depends on what type of log rotate policy is configure in file /etc/logrotate.conf
To list out numbers of available dpkg.log files below is the command:
ls -ltrh /var/log/dpkg.log*
Below is the sample output of available dpkg.log files in my Ubuntu 16.04 Linux machine.
You can use below commands for checking the installed, remove and applied updates to packages in your Ubuntu machines:
tail -f /var/log/dpkg.log
If you want to only filter out what packages are updated in your Ubuntu machine, below is the command:
grep upgrade /var/log/dpkg.log
Below is the sample output of /var/log/dpkg.log file of my Ubuntu Linux machine:
You have notice in above sample output file all logs are logged with date and time when updates were applied even apart from updates you can get the information regarding installed, removed of packages on that perticular date and time (Date and time format: YYYY:MM:DD HH:MM:SS).
Introducing another log file /var/log/apt/history.log it contains clear crystal output of installed, remove and applied updates of packages with details. Example for getting exact applied updated packages detail with particular date use below command:
grep -A4 'YYYY:MM:DD' /var/log/apt/history.log
Below is the sample of my Ubuntu machine /var/log/apt/history.log log as you can see I have applied packages update recently on 30th Sep 2018. You can see in below screenshot apart from date, which command was used for applying update and which user had requested or executed that command. Which is helpful in auditing the machine.
4,074 total views, 20 views today