Clone the same Debian packages from another target

Sometimes we need to clone machines, for such use we may refer to rsync, and when we talk about debian package the debian package manager dpkg comes with some famous options that make our clone procedure very easy :
Let’s take an example :
So we have to clone the machine nibiru (machine to restore) from the machine maya (machine to backup):
Well On maya run:
$ sudo dpkg –get-selections > /tmp/dpkg.txt
Copy the dpkg.txt file to the target to restore system and run:
$ scp /tmp/dpkg.txt mezgani@nibiru:~/

On nibiru:
$ sudo dpkg –set-selections < ~/dpkg.txt
$ sudo apt-get -y update
$ sudo apt-get dselect-upgrade


Author: Ali MEZGANI

My name is MEZGANI Ali. I was born back in 1978 in Rabat Morocco. My interests are Debian Linux , programming , science and music.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s