How to write a script that can store list of installed and removed packages

Hi guys

I would like to write a shell script that can help me to keep a list of packages that i remove or install on my system.
This is how it should work, each time i run the command:

$ sudo apt-get remove packages_name or sudo apt-get install package_name 

It should send the package_name to a file and append the file each time i remove or install a package.
There should be a different file for removed packages and a different file for installed packages.
My main aim is to keep a record of the way i use the apt-get or aptitude command to install or remove packages from my system.

Thanks in advance for your help.

Its already there in the aptitude history log, whenever we install or remove packages. We may need to manipulate data from this log. :smile:


1 Like

@wubyz Thanks did not know, will start reviewing /var/log/apt/history.log file for that case.