Maybe you want to get a read-out of all packages installed on your system. Maybe for review, maybe to put together a new bulk installer. Here's an easy way to do it.
apt tool on Ubuntu 14.04 and above makes this very easy.
apt list --installed
To get a list of packages installed locally do this in your terminal:
dpkg --get-selections | grep -v deinstall
-v tag "inverts" grep to return non-matching lines)
To get a list of a specific package installed:
dpkg --get-selections | grep postgres
To save that list to a text file called
packages on your desktop do this in your terminal:
dpkg --get-selections | grep -v deinstall > ~/Desktop/packages
Alternatively, simply use
(you don't need to run any of these commands as the superuser, so no
sudo or any other variants necessary here)
To list all packages intentionally installed (not as dependencies) by apt commands, run the following :
(zcat $(ls -tr /var/log/apt/history.log*.gz); cat /var/log/apt/history.log) 2>/dev/null | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:'
Until next time!