Home Install the same selection of packages several times on Debian
Post
Cancel

Install the same selection of packages several times on Debian

It can be useful to systematically install the same list of packages on several computers. Or keep a list of the installed packages in some computers, to expedite reinstallations. In Debian this can be done quite easily.

First, we save the list of installed packages on the computer:

1
$ dpkg --get-selections > pkg-list

Next, If we want to install these packages in another computer,we transfer the pkg-list file onto the computers we want to update. And, in the other computer:

Update dpkg’s database of known packages.

Record the list of available packages in the dpkg database:

1
2
3
4
# avail=`mktemp`
# apt-cache dumpavail > "$avail"
# dpkg --merge-avail "$avail"
# rm -f "$avail"

Update dpkg’s selections

Restore the selection of packages that we wish to install:

1
# dpkg --set-selections < pkg-list

Install the selected packages

1
# apt-get dselect-upgrade

aptitude does not have this command!

Source: The Debian administrator’s handbook - 6.2. aptitude, apt-get, and apt Commands

Enjoy! ;)

This post is licensed under CC BY 4.0 by the author.