Right now I’m busy transferring an Ubuntu install from a physical to a virtual machine. One of the issues is to get all the relevant packages installed. The following commands do just this.
- Make a list of the packages on the donor system:
- Copy the package list from the donor to the virtual system.
- Login to the virtual system, and tell
dpkgwhich packages should be installed:
- And install the packages:
paul@donor-system$ dpkg --get-selections > package_list
paul@donor-system$ ssh paul@virtual-system
paul@virtual-system$ dpkg --set-selections < package_list
paul@virtual-system$ sudo apt-get dselect-upgrade
Y, and all the missing packages will be installed on the virtual system. This is why I love a package manager! Note that this will probably work on any Debian based Linux distribution.