Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I find out what Debian package a file came from?

share|improve this question

3 Answers 3

up vote 21 down vote accepted

There are several utilites in Debian which perform this task; check this page for a description. I'll mention two of them, apt-file and dlocate.

apt-file searches its internal cache, thus allowing you to not install all the packages you want to search. Search is performed by launching apt-file search file.name.

dlocate is a fast alternative to dpkg -L (the command that lists package contents), and as so, it searches only installed packages. Search is performed by dlocate -S file.name.

Also you can search packages online using packages.debian.org server (the Search the contents of packages section).

share|improve this answer
user@host:~$ dpkg-query -S /bin/bash 
bash: /bin/bash

Where bash is the package name.

share|improve this answer

Another alternative:

$ dpkg -S /bin/bash
bash: /bin/bash

On my Ubuntu at least, both seem to be in the dpkg package, so no real advantage to any specific one...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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