Home > sysadmin > Clone your Debian server’s packages to new server with dpkg

Clone your Debian server’s packages to new server with dpkg

Make sure /etc/apt/sources.list is identical to your the file on the original server.
You may have to rsync /etc/apt from your old server to your new server if you have
installed different apt keys.

First run
dpkg –get-selections | awk ‘{print $1}’ >installed-packages ## on existing server
then sftp the installed-packages file to your new server.
on your new server, make sure you have /etc/apt/sources.list exactly like the
one on your old server.

On your new machine run:
apt-get install `cat installed-packages`

Your new server should now have all the packages your old server has.
You can copy the /etc/*.conf files to your new server (I would make a new place for them)
and add them back as needed to the new server.

Categories: sysadmin
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s

%d bloggers like this: