I’ve recently had the occasion to make a complete list of software installed while upgrading our Ubuntu 8.04 LTS server to 10.04 LTS. It’s always safe to note down all the packages already installed in the server but using this we can create a list of packages thats already installed.
Getting Started !
Use the following command to create a list of all the installed packages currently available
sudo dpkg --get-selections > /etc/package.selections
Now our package list is ready and we can copy this file (package.selections) to your new machine
sudo dpkg --set-selections < /etc/package.selections && apt-get dselect-upgrade
This command will uninstall all packages installed after you created your restore list.