Take the 2-minute tour ×

Is there an easy way of cloning entire installed debian/ubuntu system?

I want to have identical installation in terms of installed packages and as much as possible of settings.

I've looked into options of aptitude, apt-get, synaptic but have found nothing.

share|improve this question

closed as off topic by casperOne Jun 22 '12 at 15:02


add comment

8 Answers

up vote 7 down vote accepted

This guide should answer your direct question

But I would recomend Rsync and simply clone entire /root. Its only expensive the first time.

You can also create your own package repository and have all your machines run their daily updates from your repository.

share|improve this answer
The link you provided on debianadmin.com is mostly what I was searching for, and rsync for synchronization. Thank you and, hvala. –  boskom Oct 7 '08 at 8:24
add comment

How to mirror apt-get installs.

Primary System

dpkg --get-selections > installed-software
scp installed-software $targetsystem:.

Target System

dpkg --set-selections < installed-software


+1 to this post

share|improve this answer
Only missing piece: if the software isn't in a repository that is on the target system. An additional step is needed: clone the list of repositories (how?) Just copying /etc/apt/sources.list and sources.list.d won't give you the keys –  stwissel Jun 10 '12 at 11:21
That's exactly what I was looking for - thanks, @PatrickS.Roberts –  Crontab Apr 10 '13 at 13:45
add comment

Supposing you want to install Ubuntu on multiple identical systems you could try with the Automatic Install feature.

share|improve this answer
The links gives a 404 –  Server Horror May 23 at 21:12
add comment

You can use rsync for that and there is an interesting thread about it on ubuntuforms: ubuntuforms

share|improve this answer
add comment

There is RSYNC which let's you synchornise files between installations. So you could just rsync your entire distro, or at least the directories that contain the programs and the configuration files.

Also, I don't know if this is what you are asking, but you could turn your existing install into an ISO image, this would allow you to install it elsewhere, thus having a duplicate.

Hope that helps

share|improve this answer
add comment

If the drives and systems are identical, you might consider using dd to copy the source machine to the target.

The only changes that would need to be made on booting the new machine would be to change the hostname.

Once the machine has been duplicated, go with what the other answers have suggested, and look at rsync. You won't want to rsync everything, though: system log files etc should be left alone.

Also, depending on how often "changes" are made to either system (from bookmarks to downloaded ISOs), you may need to run rsync in daemon mode, and have it update nearly constantly.

share|improve this answer
add comment

SystemImager FAI

We have systemimager working great with RHEL and CentOS. Haven't tried it on Debian. The trick linked by Luka works great with debian though.

share|improve this answer
add comment

Well it all depends on scale, and how often you want to use it, using systemimager is basicly rsync on steroids, it has some scripts which make creation of images easy and allows you have network settings etc. This can be easily used where you need to create a farm of webservers or a farm of mailserver with only a small difference between installations where you are able to boot one blank system over the network and have it completely installed. This has the advantage that it's almost completely automated, a script learn your partitioning layout and automatically applies it.

When you only need one copy of a system, keep it simple, boot from a livecd, create your partitioning, copy over network using rsync, install your bootloader and everything 'll be fine.

share|improve this answer
add comment
