cloning a debian system from one machine to another
Hi,
I know this has been asked many times and some information is available on Internet but a while back I had tried that and I did not get the expected result. So here is the thing. I have a Debian Machine A which I have customized by adding/removing several packages over last 2-3 months. Now I recently installed a base system from Debian NetInstall CD (called it as Machine B) Now What I want is that MAchine B should be an exact clone of MAchine A (packages wise). In short, whatever packages are there on Machine A should be on Machine B, and whatever packages are there on Machine B and not on Machine A, should be removed from Machine B. I know people suggest using Code:
dpkg --get-selections I am using apt-get and NOT aptitude. Also I am not willing to move on to aptitude. Oh yes, both the machines are debian etch (stable) THanks |
Did you use google at all?
I'm guessing not, as this info is all over the place. Here's to your laziness - Code:
dpkg --get-selections | grep '[[:space:]]install$' | awk '{print $1}' > packagelist.txt Peace, JimBass |
Quote:
I had one question: Will your solution remove the packages that from Machine B which are not there on Machine A? Thank you once again for the reply. Edit: Here is what I had found over the internet before: Code:
On the source machine: |
Quote:
|
Quote:
Hmm...So What should I use? Code:
apt-get -u dselect-upgrade Code:
apt-get -u install `cat packagelist.txt` |
Quote:
|
To uninstall packages from B that are not on A, (which I wouldn't bother doing, as it will make little difference in space) -
Just change things around a bit. Which ever command you use to get the list of packages on A (dpkg --list or dpkg --get-selections), use on B, and make the output name slightly different, like packlist2.txt, or file2.list. Then run a diff command on the 2 lists, packagelist.txt and packagelist2.txt, or file.list and file2.list. Save the output of the diff command to another file, say remove.list, then ultimately, do Code:
apt-get -u remove 'cat remove.list' Peace, JimBass |
All times are GMT -5. The time now is 08:55 AM. |