How can I log the installation of packages in Ubuntu? I want to send a message to log every time after a package is installed, like, "Package Installed" with the name of package & it should do that after uninstalling too. Is this possible? I am logging all this in a file called "Local3.log".
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
It appears that apt logs this data here: /var/log/apt/term.log This blog had this and more info on package logging: http://tech.zhenhua.info/2010/11/package-installation-log-on-ubuntu-dpkg.html |
|||
|
|
|
Yes you can do it. (You can use /var/log/apt/history.log* files or the method below) First you have to create a shell script named apt-get(as shown below) Then you have to add it to your PATH variable. You can do it by adding it to the /etc/profile for example if your script is located in /home/ankur/ you have to add a line to /etc/profile like the line below. export PATH=/home/ankur/:$PATH Now whenever you execute apt-get our script executes first (This might not be the perfect script) apt-get
|
||||
|
|
