How can I determine if a package is a meta-package from the command line, possibly via apt-get, aptitude or apt-cache?
I have tried:
apt-cache show texlive-full
apt-cache showpkg texlive-full
but the only way I can tell this package is meta is by reading the "en-description" field.
Is there a more automatic way of doing this, that will give me a yes/no response, or at least have a field such as then "en-description" dedicated to this?
There is no formal definition of a metapackage. The informal definition is that a metapackage is one that is only intended to be installed for its dependencies and contains no useful file of its own.
You can define a metapackage as a package that contains no file. There is no way to determine this from the package database. You can use the file database and check that the package contains only directories (many such packages contain a few directories). In fact, most metapackages contain a few files in
/usr/share/doc/<package name>
: acopyright
file, a changelog, sometimes a few more. Here's an approximation that defines a metapackage as containing only files in/usr/share/doc/<some directory>
(not in subdirectories of that) and the leading directories:Another approach is to look for a package tag with
debtags
. There are several tags that are commonly used on metapackages.Another approach is to look for packages with a small size. Each directory counts as 4 kB, so plan accordingly when picking a threshold (again, this is an approximation).
Upon reflection, I wonder if you mean virtual packages rather than metapackages. Virtual packages are actually not packages but package names used in
Provides:
fields. You can list them withaptitude search '~v'
. Runningapt-cache show
on one displays “Can't select versions from package 'zcav' as it is purely virtual”. Runningaptitude show
lists the packages that provide it. A convenient way to show virtual packages is withapt-cache
: this prints one line for a non-virtual package and potentially multiple lines (one for each provider) for a virtual package — you can tell if the package is virtual even if there is a single provider because the name of the provider is different.You could try entering
which will give you a long list, and then use
grep
to, say show all science related metapackages withThis will return a long list (I have shortened it here)
You can use any number of alternatives for science, such as
KDE
to find all theKDE
metapackages.This is probably about the best you can do with
apt-cache
, but it should quickly locate most of the metapackages you want to find. If it doesn't find exactly everything you were looking for, the simplest thing is to look in the metapackage section inSynaptic
.