Saturday, November 04, 2006

Ubuntu - cloning package installations

Right - you have a Ubuntu system in which you have used for quite a while and installed a lot of programs. You now want to install the same set of applications on another machine or maybe even save up in case you want to reformat.

Here are the steps

1. Export the list of applications using

dpkg --get-selections | grep '[[:space:]]install$' | awk '{print $1}' > list_of_packages

2. Copy your /etc/sources.list from the current machine and copy to your target machine

Now on your target machine

Do

1. sudo apt-get update

to update the sources list

2. cat list_of_packages | xargs sudo apt-get install

to install the packages!

1 comment:

Vivek said...

Here is a simpler way:

dpkg --get-selections > list

On Target machine:

dpkg --set-selections < list