Sometimes you need to reinstall a Debian system. Maybe your hard drive is going pear-shaped, maybe you got a new computer, maybe you are replicating a system, maybe you are building a lab. In any case, if you want all the packages that are installed on system 1 on your new/other system 2, here’s an easy way:
- On system 1, make a file with your installed/removed packages:
dpkg --get-selections > packages.txt
- Get a base install done on system 2, and set
/etc/apt/sources.list
to be the same as on system 1 - Get
packages.txt
onto system 2 - Run
dpkg --set-selections < packages.txt
on system 2 - Run
dselect install
on system 2 - Optional: Dance