7

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?

lazyPower
  • 5,371

1 Answers1

11

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  
desgua
  • 32,917
enzotib
  • 93,831
  • 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. – Jeremy Bicha Apr 29 '11 at 01:54
  • Why would it mess it up? – matanox Jan 09 '15 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 09 '15 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 09 '15 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: http://askubuntu.com/questions/9135/how-to-backup-settings-and-list-of-installed-packages/486634#486634 – enzotib Jan 10 '15 at 08:01
  • Wow, I wonder why apt-clone isn't the most commonly cited answer to being with... – matanox Jan 10 '15 at 14:25