1

How can I give a list of packages installed via apt a name, eg. one that I could find with dpkg-query -W my-packages or something similar? For example, call the group build-essential checkinstall gparted ... of packages my-packages

Rationale: I would like to be able to check if default groups of packages have been installed in my install scripts.

Running Ubuntu 18.04

2 Answers 2

1

The equivs package seems to do exactly what I wanted, very simply creating a .deb file that can be installed and queried using dpkg-query. See tutorial for walk-through.

1

Beside using a meta package I would use a variable:

$ packages="coreutils wget"

$ dpkg-query -W $packages
coreutils   8.28-1ubuntu1
wget    1.19.4-1ubuntu2.1

$ echo $?
0

Means everything is fine (1) means something is missing.

Find a list of missing packages:

$ packages="coreutils wget 0ad pkg1 nonexits"
$ dpkg-query -W $packages 2>&1 > /dev/null | rev | cut -f1 -d' ' | rev
0ad
pkg1
nonexits
2
  • 1
    useful alternatives, thanks! The negative is I wouldn't be able to simple check my bundles had been installed from different scripts later on.
    – Rorschach
    Jan 8, 2019 at 23:49
  • Yeah, it would be messy... Then I guess meta-packages are your best shot.
    – Ravexina
    Jan 8, 2019 at 23:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .