List all software installed from particular component (non-free, contrib)

  • dpkg-query -W -f='${Section}\t${Package}\n' | grep ^non-free
  • aptitude search '~i ?section(non-free)'

Section will be non-free/... for everything from the non-free path.

[Note] for gcc docs...

 This documentation is licensed under the terms of the GNU Free
 Documentation License, and contains invariant sections, so it can't be
 part of Debian main.

(I wondered about that too, but didn't bother checking until it was mentioned.)


There is a program called VRMS (a virtual Richard M. Stallman) which will report all the non-free software on your system in a short summary. Its in the repo's and you can install it via apt ;-)


I had a similar 'urge' a few years ago and could not determine that the orginal package information is kept on the system after downloading the package. I don't think this information is available to dpkg.

So what I ended up was setup a clean virtual machine, setup the appropriate /etc/apt/sources.list and installed the whole list generated by:

dpkg --get-selections | fgrep -v deinstall | cut -s -f 1

the packages that would not install (I only did download to save some time with apt-get -d).

You might be able to do a similar thing using apt-get --root-directory=some_dir after temporarily changing your sources.list, but I would not sure if that uses your current install database and just moves the package there. A VM for this kind of experimenting is much safer. I normally have a clean basic install of my current Linux as VM, so I only have to clone that (not that installing Linux on a VM takes that long).

Tags:

Debian

Dpkg

Apt