Get list of installed programs from dead disk ubuntu debian

If you have a dead installation, some will not boot you can use this commands, to get the list of installed programs.
grep -B 1 \
"^Status: install ok installed$" /media/recovery2/var/lib/dpkg/status | \
awk '/^Package:.*$/{print $2"\t\tinstall"}' | \
sort > package.list
And this command to install it on a new installation:
dpkg --set-selections < package.list
apt-get dselect-upgrade

Leave a Reply

Your email address will not be published. Required fields are marked *