MiniHOWTO: Save and recover full list of installed packages with dpkg

Oh, the things you catch flying by on the mailing lists! This tip comes from Ulrich GrĂ¼n:

To make installation of your favoured packages more easy, you could save your list of installed packages from your old system, and then use this list for your new one:

dpkg –get-selections > list-of-installed-packages

dpkg –set-selections < list-of-installed-packages

then with aptitude with option ‘g’ or with synaptic or other packaging programme: installation of this list of packages. Maybe, an apt-get upgrade will do this as well (not tested)

One very important thing to note, as another poster in that thread brought up, is to always check the list and make sure you know what you’re doing before you use it as basis for an upgrade, especially if the list is from a different version (Gutsy to Hardy, for instance), or you could really hose yourself. But god damn, I can’t count how often I’ve looked for something like this! Thanks, Ulrich!

Leave a Reply