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?


1 Answer 1


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  
  • 1
    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. Apr 29, 2011 at 1:54
  • Why would it mess it up?
    – matanox
    Jan 9, 2015 at 17:15
  • 3
    @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, 2015 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?
    – matanox
    Jan 9, 2015 at 23:27
  • 1
    @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: askubuntu.com/questions/9135/…
    – enzotib
    Jan 10, 2015 at 8:01

Not the answer you're looking for? Browse other questions tagged .