Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Possible Duplicate:
Best way to backup all settings, list of installed packages, tweaks, etc?

I've heard that I can dump the dpkg package list of currently installed applications, then after I re-install, re-import that list and have apt or dpkg do all the heavy lifting for me getting my apps re-installed.

How do i do this?

share|improve this question

marked as duplicate by Marco Ceppi Jun 5 '11 at 19:50

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

up vote 8 down vote accepted

To dump the list of currently installed applications:

dpkg --get-selections >output-file  

To re-import:

sudo dpkg --set-selections <output-file 
sudo apt-get dselect-upgrade  
share|improve this answer
The one reason I hate doing this is it messes up the "automatically installed" feature of apt where unneeded dependencies can be removed but that may not be a big deal to normal users. – Jeremy Bicha Apr 29 '11 at 1:54
Why would it mess it up? – matt Jan 9 at 17:15
@matt because all packages installed with the third command result as manually installed, even if they were automatically installed in the original machine. The command apt-mark could be of help here. – enzotib Jan 9 at 18:30
@enzotib how exactly do you suggest using apt-mark? does this not assume one remembers which packages were automatically installed in the first place? – matt Jan 9 at 23:27
@matt: no, the information about the manual/automatic state of the packages is maintained somewhere in apt files. Also, in one of the answer to the question of which this is supposed to be a duplicate (see at top of page) is indicated apt-clone as a better solution to the whole problem we are facing:… – enzotib Jan 10 at 8:01

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