Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Meta packages are packages that do not install anything by themselfs, but are dependent on other packages. How do I list the installed meta packages on my system?

share|improve this question
I think there's no other way than the brute force one: check all installed packages and report those whose installed files are only /usr/share/doc/$pkg/(copyright|changelog)*. – angus Jan 21 '12 at 23:30

1 Answer

Try the following command, that list the name of every installed package that has the string "metapackage" in its section field in apt-cache show output:

apt-cache show $(dpkg-query -Wf '${Package}\n') | 
  awk '$1 == "Package:" { pkg = $2 }; 
       $1 == "Section:" && $2 ~ /metapackage/ { print pkg }'
share|improve this answer
Maybe you mean “Description” field? But then, there is also (at least) “meta-package” and “meta package”... – angus Jan 22 '12 at 11:25
@angus: no, I mean exactly section field: at least in Debian and in Ubuntu real metapackages are in section metapackages and multiverse/metapackages. – enzotib Jan 22 '12 at 11:30
Isn't (for example) emacs a metapackage? I have it in section “editors”. Its description says: “The GNU Emacs editor (metapackage)”. (?) What's an example of a package in section “metapackage”? I couldn't find any :-/. – angus Jan 22 '12 at 14:23
OK, with perl -n00e 'print if /^Section: .*metapackage/m' /var/lib/apt/lists/*Packages I found 4 of them. I don't think it's a very reliable method... – angus Jan 22 '12 at 14:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.