Ubuntu – find a complete list of packages that I have installed after initial installation

defaultpackage-management

I want to save the list of packages that have installed. I figured it might be the best to list all and diff it with the default set.

Edit: Clarification: I don't want to get the list of installed packages that are installed at the moment. Rather I want to get the list of packages that I added since the default install.

Best Answer

either

sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n

or

sudo sed -ne '/^Package: \(.*\)/{s//\1/;h;};/^Installed-Size: \(.*\)/{s//\1/;G;s/\n/ /;p;}' /var/lib/dpkg/status | sort -n

or

sudo dpkg --get-selections

will list all the packages.

Just re-route the output to a file. The 1st two lines will list it from smallest to largest with the size in front of the package name. The 3rd is in alphabetical order.