Generate a list of installed deb packages on one device (and install on another)

Last updated on 2022-01-30 Tagged under  #debian   #mint   #linux   #bash   #programming 

When setting up a new device with Debian or Linux Mint, it can be useful to have an updated list of all the deb packages installed on the current device, and replicate that configuration on the new device.

This is how I do it ...

Make a list

Make a list of *.deb packages installed on current device, and save to $LIST ...

$ LIST="${HOME}/deb_pkglist_${HOSTNAME}"
$ dpkg-query -f '${binary:Package}\n' -W > $LIST


I wrote a script - aaa - that combines in a single command:


Replicate the list on another device. Copy $LIST from current device to the new device.

Install $LIST contents ...

$ sudo xargs -a $LIST apt install

Note: Confirm the new device lists the same repositories in /etc/apt/sources.list as the current device. Otherwise, some packages in $LIST might not be available.

Sources: deb_pkglist and aaa

Thanks for reading! Read other posts?

» Later: Getting started with Neovim

« Earlier: Dot bashrc