Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I want to format my system, but I don’t want to lose my updates and installed packages. I also want the same packages on other systems as well.

share|improve this question

marked as duplicate by vasa1, Thomas W., Kevin Bowen, Mitch, Seth Aug 25 '13 at 16:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

Backing up should be:

dpkg --get-selections > ~/Package.list
sudo cp /etc/apt/sources.list ~/sources.list
sudo apt-key exportall > ~/Repo.keys

and restoring should be

sudo apt-key add ~/Repo.keys
sudo cp ~/sources.list /etc/apt/sources.list 
sudo apt-get update
sudo apt-get install dselect
sudo dpkg --set-selections < ~/Package.list
sudo apt-get dselect-upgrade -y

...If I'm not mistaken.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.