19 June 2013

Saurav Modak's picture
Posted by Saurav Modak on August 10, 2012
linux

Quite often, you may need to reinstall/upgrade Ubuntu/Linux Mint and it means installing all the programs you need. Thus we waste a large amount of time just installing programs. However, there is a simple solution that will allow you to clone all the programs installed in your computer so that you will have an exact copy of programs installed before.

For this, open terminal and run the following command:

dpkg -l | awk '/^ii/ { print $2 }' >package-list

this will make a list of all programs you have installed in a package-list file.

Next, open the computer you wish to install the packages to, and type:

xargs apt-get install -y < package-list

Thus you can clone all the programs you have with just a single command.

Note: this works in all the distros that have apt package manager. The target and parent computers must use the same operating system/sources.

Saurav Modak

Saurav Modak is an engineering student and FOSS enthusiast who believes that best things in the world, such as software should be free (as in freedom). He is a hard core Arch fan and loves to show off his customized Arch Linux installation to friends. You can connect with Saurav on Facebook, Google+ and Twitter.