Re: Installing same packages in a Squeeze installation in a new Wheezy installation
On Monday, November 04, 2013 01:20:01 PM Tony van der Hoff wrote:
> No, it didn't work for me. I would have much preferred to automate this.
> However, AFAICT the tools aren't available, and the time comes where you
> feel you're beating your head against a wall. That's when I gave up.
>
> I'm not suggesting anyone should follow my path, it's dismal. I was
> merely relating my experience. If someone would contribute a WIKI on
> exactly how to do this, they'd win my eternal gratitude.
[This is an attempt to summarize various suggestions in a single msg.]
The theory is that --get-selections will list all installed pkgs in a form
that can be used by --set-selections to (re)install them.
So, on the existing system:
# Mount a thumb drive; change 'sdg' as needed
mount /dev/sdg1 /mnt
# Save the list of pkgs
dpkg --get-selections > /mnt/current_installed_pkgs.txt
# Umount, then unplug the drive
umount /mnt
And on the new system, first netinstall a basic system. Then
# Mount the thumb drive; change 'sdd' as needed
mount /dev/sdd1 /mnt
# Set the list of pkgs to install
dpkg --set-selections < /mnt/current_installed_pkgs.txt
# Unmount and remove the thumb drive
umount /mnt
# Start the 'upgrade'
apt-get dselect-upgrade
When done, the new system should have the same pkgs as the old system. It
won't be identical, but it'll be close.
This is almost straight out of dpkg's man page. If it doesn't work, perhaps a
bug report should be opened.
To make the new system nearly identical to the old system, plug the new
system's drive into the old system (hot-plug SATA or SAS is good; the new
drive needs to be at least as large as the old drive).
# Copy the current drive to the new drive; change sda and sdc as needed.
dd if=/dev/sda of=/dev/sdc bs=1024k
Mount the new system's filesystems and adjust the hostname, IP address, etc.
Then unmount and unplug. You may need to let it replay journals and fsck the
FSen.
Plug the new drive into the new system and power it on. It should be a replica
of the old, except for the ID bits you changed.
If you want to start with Squeeze, for example, and end up with Wheezy, it'd
probably be better to get Squeeze's pkgs, install Squeeze on the new system,
upgrade to Wheezy, then use the resulting list from --get-selections to
install more Wheezy systems.
Note that this addresses pkgs, *not* configs. Configuring the new systems is a
separate step.
Reply to: