Is it possible to log all items installed, modified, removed? (Ubuntu Server 14.04.2)
Is it possible to log automatically when things are installed, removed or modified at my Ubuntu server? It would be nice if I can view the log to see what I (as root) did modify, install, remove.
I'll hope this is possible and I'll hope someone can explain me how to setup such thing.
Kind regards, Kevin
2 Answers
It's already done (at least for things installed via Softwarecenter etc.). Please check /var/log/dpkg.log or as mention in the comments via /var/log/apt/history.log
In GUI you can do it from Ubuntu Software Center, go to the tab History and there you can find every thing.
But now for you as you using ubuntu server 14.04 then the above is not valid so you should search from files, basically those history is located under:
/var/log/dpkg.log* And
/var/log/apt/history.log*And Why I put * because there is more than one file as stated above, For example:
$ ls /var/log/dpkg.log
dpkg.log dpkg.log.12.gz dpkg.log.5.gz dpkg.log.9.gz
dpkg.log.1 dpkg.log.2.gz dpkg.log.6.gz
dpkg.log.10.gz dpkg.log.3.gz dpkg.log.7.gz
dpkg.log.11.gz dpkg.log.4.gz dpkg.log.8.gz So indeed log will be compressed and moved when it reaches some size.
Now to know for example let's know recently installed packages that were installed via any method
cat /var/log/dpkg.log | grep "\ install\ "Example output:
2015-07-01 13:56:40 install htop <none> 1.0.1-1let's know recently installed packages that were removed
cat /var/log/dpkg.log.1 | grep "\ remove\ "Example output:
2015-06-02 08:34:18 remove dconf-tools 0.12.0-0ubuntu1.1 <none>
2015-06-04 13:15:06 remove bitmeteros 0.7.6 <none>
2015-06-04 13:16:25 remove bitmeteros 0.7.6 <none>
2015-06-08 11:34:33 remove jack 3.1.1+cvs20050801-26build1 <none>
2015-06-09 08:35:05 remove nautilus-dropbox 0.7.1-2 <none>
2015-06-26 11:53:29 remove dconf 0.5.1-2 <none>