2

I want to figure out EACH and EVERY package/software installed on an Ubuntu (14.04/16.04) system.

From my understanding and several discussions on SE and elsewhere, like unix_stack_exchange ask_ubuntu, it looks like whatever packages/software is installed on the system, dpkg will ultimately be used (be it for the package itself or it's dependencies).

  1. So does it mean that dpkg will always give a more comprehensive list of all the packages installed on the system (including dependencies etc.) than apt-get ?
  2. And is it safe to assume that dpkg can be used to list ALL the software (user/system/etc. applications) installed on a system ?
6

dpkg -l will always give the correct list of installed (or removed but still configured) packages. It actually uses dpkg-query to do its job, and that references the contents of /var/lib/dpkg/status which is the reference for installed packages.

apt uses the same information, but until recently didn't provide an easy way to list packages; apt list now does that, and you'll get the same results as given by dpkg -l (in a different format).

dpkg can be used to list all packages. If all the software on a system is installed using packages, then it will list all the software; but if any software has been installed manually, without a package, then it won't know about it.

  • So in case of manually installed things, say python modules installed via pip etc. is there a generic linux way of figuring out all of these as well, I mean without actually using pip or python utilities itself. I want it to be generic enough that I can simply use it to figure out all possible modules/plugins etc. of any software, eg. vim, python etc.? – qre0ct Feb 9 '17 at 7:59
  • 2
    There's no generic way as far as I know. On Debian derivatives, tools such as cruft (in the cruft package) can help you list files on your system which don't come from packages, but figuring out where they come from and what they correspond to is a manual process. – Stephen Kitt Feb 9 '17 at 8:55
3

You can use apt with options (man apt-cache , man apt ..) to get the needed information

dpkg or apt?

dpkg should be seen as a system tool (backend), and apt as a tool closer to the user, which overcomes the limitations of the former. These tools work together, each one with its particularities, suited to specific tasks.

e,g 1: you can list the installed package on your system through dpkg or apt:

apt list --installed
dpkg -l

e,g 2 :To find out the dependencies you can use apt-rdepends , or apt-cache showpkg ...

apt-rdepends <package_name>
apt-cache showpkg <package_name>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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