Extract Ubuntu Installed Package list

A way to get a list of all packages installed on your machine use the following command.

dpkg –get-selections > my-pkg-list

You can later reinstall the packages in the list using this command:

dpkg –set-selections < my-pkg-list
sudo apt-get -u dselect-upgrade

This list will include both packages you installed, and their dependencies.