Friday, November 30, 2007

backup ubuntu / debian package selection list


sudo dpkg --get-selections > dpkglist.txt

sudo dpkg --set-selections < dpkglist.txt
sudo apt-get -y update
sudo apt-get dselect-upgrade


Anonymous said...

Hey there, nice tutorial. But you may should clear the dpkg-selections:
sudo dpkg --clear-selections


Chris Bainbridge said...

You can also use apt-clone (apt-get install apt-clone).

To backup: apt-clone clone .

This makes a more complete backup, containing source repositories and whether the package was auto-installed or not. It will also tell you if any of your packages aren't in the configured repositories.

To restore: apt-clone restore apt-clone-state-zzzz.tar.gz

leo said...

Oh, that's really cool! Thanks, Chris!

Anonymous said...

I tried apt-clone and all I got was:
apt-clone -l
usage: apt-clone [-h] [--debug] {info,clone,restore,restore-new-distro} ...
apt-clone: error: too few arguments