Migrate installed packages to a new system

Say you get a new system at work and you want a clean install of everything on the new system that you have on your old one. It's actually quite simple.

Once you have a base install on the new box just copy over the /etc/apt/sources.list from the old system to the new one and then update the new system:

new_sys$ apt-get update && apt-get upgrade

then on the old system do the following:

old_sys$ dpkg --get-selection | grep -v deinstall > installed-packages.txt

Then you copy installed-packages.txt to the new system. Now all that's left is to install the packages on your new system:

new_sys$ dpkg --clear-selections
new_sys$ cat installed-pakcages.txt | dpkg --set-selections
new_sys$ apt-get dselect-upgrade
/var/customers/webs/cw01/wiki/data/pages/debian/migrating_to_a_clean_system.txt · Last modified: 2011/02/10 13:23 by wadmin
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki