How To: List Files in Ubuntu/Debian Package

If you’re ever looking for a specific list of files included with one of the packages on your Ubuntu/Debian/Mint Linux setup, here’s how you can do it using the dpkg command:

# dpkg --listfiles libcurl4-openssl-dev
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/libcurl.pc
/usr/lib/x86_64-linux-gnu/libcurl.a
/usr/lib/x86_64-linux-gnu/libcurl.la
/usr/share
/usr/share/doc
/usr/share/doc/libcurl4-openssl-dev
/usr/share/doc/libcurl4-openssl-dev/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/curl-config.1.gz
/usr/share/aclocal
/usr/share/aclocal/libcurl.m4
/usr/include
/usr/include/curl
/usr/include/curl/curlver.h
/usr/include/curl/mprintf.h
/usr/include/curl/stdcheaders.h
/usr/include/curl/easy.h
/usr/include/curl/curlrules.h
/usr/include/curl/multi.h
/usr/include/curl/curlbuild.h
/usr/include/curl/typecheck-gcc.h
/usr/include/curl/curl.h
/usr/bin
/usr/bin/curl-config
/usr/lib/x86_64-linux-gnu/libcurl.so
/usr/share/doc/libcurl4-openssl-dev/changelog.Debian.gz
/usr/share/doc/libcurl4-openssl-dev/NEWS.Debian.gz

The same can also be done with the shorter version of the command line option: dpkg -L

One of the most typical things to check next would be to verify the integrity of all these files in the package – usually dpkg keeps checksums for all the files installed.

Verifying integrity of files instlaled by the package:

# dpkg --verify libcurl4-openssl-dev
??5?????? /usr/include/curl/curl.h

In this example I have gone and edited the comment in the curl.h header file, just to change it enough for dpkg to pick it up. Since checksums are used for highlighting differences and also because most of package installed files are binaries or special non-cleartext formats, you don’t see the text-based diff but instead just get an indication that certain file differs from the original version installed by dpkg.

The shorter version of the same is dpkg -V.




Keep Learning

Follow me on Facebook, Twitter or Telegram:
Recommended
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets