Friday, November 30, 2007

backup ubuntu / debian package selection list

HowTo

Backup:
sudo dpkg --get-selections > dpkglist.txt

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

4 comments:

Anonymous said...

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

Thx

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