5

My understanding is that debian based packages have "control files" which specify metadata on how the packages is to be installed, e.g. what dependencies it has etc.

How can I view these files for installed packages?

4
  • Some of the metadata is located in /var/lib/dpkg/info; however, those are just the files installed and the pre/post (un)installation scripts. Apr 13 '15 at 2:22
  • thanks, in my machine /var/lib/dpkg/info is empty but good to know for the future Apr 13 '15 at 2:26
  • That's odd. Does dpkg -L base-files list anything? Apr 13 '15 at 2:27
  • dpkg -L base-files list about 50 or so directories , including /var/lib/dpkg but doesnt include /var/lib/dpkg/info Apr 13 '15 at 2:34
7

For dependency information, you can see /var/lib/dpkg/status, which basically lists the contents of debian/control (with some additional information about the package itself) for each installed package.

Additionally, you can look into /var/lib/dpkg/info to see the files installed, pre/post (un)installation scripts (if any), and configuration files (if any) for each installed package.

3
  • this looks right on - i.e. looks like its showing dependency info as well as current status. Is this the data that the command dpkg -s <package name> will look up against to find its info? Apr 13 '15 at 2:31
  • 1
    Using strace, at least /var/lib/dpkg/status is used by that command. I can't confirm that the /var/lib/dpkg/info is used, but I would think it is. EDIT: The /var/lib/dpkg/info folder is not used by that command, but is probably used by dpkg -S <file name> (when finding out what package a file comes from). Apr 13 '15 at 2:35
  • upvote, very useful answer as this information is always available, I've gone with Charles Wrights answer as it seems in order to get the full picture you need to get your hands on the actual .deb package Apr 13 '15 at 2:52
2

Open the .deb file in file roller or whatever archiver you have on your system. Then go to the debian folder. In there, you will find the file control which contains the metadata.

3
  • thanks for the response, the packages I'm looking at are already installed - I dont have a .deb file available - do you know where I would check in that case? Apr 13 '15 at 2:12
  • 1
    search for deb files inside the /var/cache/apt/archives there you will find installed debs if you havent removed manually
    – bolzano
    Apr 13 '15 at 2:14
  • the install paths are in the /var/lib/dpkg/info/*.list files and you can see the dependency's with apt-cache depends <package name> and you can just open synaptic and find the package you are interested in , click it,and then from the menu package>property’s to see all this as well . Apr 13 '15 at 2:34
2

The *deb file are not kept for installed packages. To view the control file for a given package:

apt download <package name>
dpkg-deb -I <package name*deb> control

To get a list of installed packages:

apt list --installed

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.