Sometimes you need to know to which debian or ubuntu package a specific file belongs, e.g. because you deleted a system file and want to reinstall it. There is a handy utility called apt-file which searches for a filename in all debian packages.

Installation

apt-get install apt-file

Usage example

search for the file /etc/sysctl.conf

apt-file search /etc/sysctl.conf

result:

apt-file search /etc/sysctl.conf
procps: /etc/sysctl.conf
mypc:~#

Now we see that the file is part of the debian / ubuntu package with the name "procps".

Find the .deb package that contains a specific file on Ubuntu or Debian Linux

One thought on “Find the .deb package that contains a specific file on Ubuntu or Debian Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

*