Create a list of packages from your Debian

Michael

Administrator
Staff member
Feb 11, 2022
126
4
18
Create a list of packages from your Debian:

To create a txt file:
Code:
 dpkg --get-selections '*' > /tmp/selections.txt

To reinstall the packages from the txt file:
Code:
awk '$2=="hold" || $2 == "install" {print $1}' /tmp/selections.txt |
  xargs -r apt-get -d -y reinstall

To print a list:
Code:
dpkg -l | awk '/^ii/ { print $2 ;}'