Home > computers > linux > Distros > debian > DebianPackageManagement > debianpackagecloning | About

Say you want to get all the software and libs installed in machine A into machine B

Good method using aptitude

On A, search for all installed packages, excluding automatically installed and virtual ones.

$ aptitude search -F%p '~i!~M!~v' > packages.lst

On B, install the packages listed in packages.lst

$ xargs aptitude --schedule-only install < package_list
$ aptitude install 

Bad method using dpkg and dselect

This method uses dpkg selections, which do not preserve the information about which packages were installed automatically.

On A

$ dpkg --get-selections > packages.lst

On B Install deslect

$ apt-get install dselect

Update the packages cache of dselect

$ dselect update

Get packages.lst from A

$ scp A:/path/to/packages.lst .

Select the packages you want to install

$ dpkg --set-selections < packages.lst

Install them with a special argument to apt-get

$ apt-get dselect-upgrade

contact : @ychaouche yacinechaouche at yahoocom

QR Code
QR Code Good method using aptitude (generated for current page)