Skip to content

Did you know?

dpkg -S (Debian, Ubuntu) or rpm -qf (Fedora, RHEL) tells you which package installed a file.

To search packages you have not installed yet, use apt-file or dnf provides.

Explained

Where did this binary or config file come from, and which package do you reinstall if it’s broken? Ask the package database.

Debian and Ubuntu:

dpkg -S /usr/bin/ssh
openssh-client: /usr/bin/ssh

Fedora, RHEL and derivatives:

rpm -qf /usr/bin/ssh
openssh-clients-9.9p1-7.fc43.x86_64

Both only know about installed packages. To find which package would provide a file or command you don’t have yet:

dnf provides /usr/bin/dig
sudo apt install apt-file && sudo apt-file update
apt-file search bin/dig

If dpkg -S finds nothing, the file was probably created by hand, by a script, or by software installed outside the package manager, for example under /usr/local or /opt.

Learn more

← All tech tips · Suggest a fix

Back to top