apt-file, or how to know which package a certain file belongs to

Has it ever happened to you that you couldn't build a package due to a missing dependency? A similar situation can occur when we want to compile a program or run a binary. In all cases, a style error: "missing X file, impossible to perform the requested task". But How do you know what other package that file is in, so that you can install it and fix the problem? Well this is where apt file it can be of great help.


To install apt-file:

sudo aptitude install apt-file

After installation, apt-file needs to create its internal index:

apt file update

The process takes a few minutes to complete, depending on your Internet connection. After the process is complete, you can now search for the missing file:

apt-file search FindKDE4Internal.cmake

And apt-file will return an output line with the package you have to install, for example:

kdelibs5-dev: /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake

That means you have to install kdelibs5-dev.

Source: commulinux & maengora


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.