How to get the files of a package on Ubuntu
December 8th, 2007
To get the list of the contents of an installed package on Ubuntu, try this command:
or alternatively:
For the reverse action, that is, to find which package a file belongs to, try this command:
or alternatively:
Replace file-pattern with part of the filename you're searching for, or even the full path.
For example, we will find out which package contains the file /usr/share/java/servlet-api-2.4.jar:
The package we're looking for, is: libservlet2.4-java
dpkg -L package-nameor alternatively:
dpkg --listfiles package-nameFor the reverse action, that is, to find which package a file belongs to, try this command:
dpkg -S file-patternor alternatively:
dpkg --search file-patternReplace file-pattern with part of the filename you're searching for, or even the full path.
For example, we will find out which package contains the file /usr/share/java/servlet-api-2.4.jar:
giannis@giannis-desktop:~$ dpkg -S /usr/share/java/servlet-api-2.4.jar
libservlet2.4-java: /usr/share/java/servlet-api-2.4.jarThe package we're looking for, is: libservlet2.4-java