• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

apt-file: command not found

by admin

apt-file is a command-line utility that allows you to search for files in packages in the Advanced Packaging Tool (APT) package management system. APT is a system used to manage software packages in Debian and other Linux distributions.

The apt-file command is useful when you need to find out which package includes a specific file, or when you want to list the files that are provided by a particular package. This can be helpful when you need to install a package that provides a specific file that you need, or when you want to know what files are included in a package that you are considering installing.

To use apt-file, you will need to first update the package index with the command apt-file update, which downloads the package index files from the package repositories. Then you can use the apt-file search command to search for a specific file, or the apt-file list command to list the files provided by a particular package.

For example, to search for the file /usr/bin/ls, you would use the command:

# apt-file search /usr/bin/ls

This would display a list of packages that include the file /usr/bin/ls. To list the files provided by the package coreutils, you would use the command:

# apt-file list coreutils

This would display a list of all the files provided by the coreutils package.

apt-file is a useful tool for finding out which package provides a specific file or for listing the files provided by a package. It is especially useful when you are working with a minimal installation of a Linux distribution and need to find out which package to install to get a specific file or set of files.

If you encounter the below error while running the apt-file command:

apt-file: command not found

you may try installing the below package:

# apt-get install apt-file

apt-file Command Examples

1. Update the metadata database:

# apt update

2. Search for packages that contain the specified file or path:

# apt-file {{search|find}} {{partial_path/to/file}}

3. List the contents of a specific package:

# apt-file {{show|list}} {{package_name}}

4. Search for packages that match the regular_expression:

# apt-file {{search|find}} --regexp {{regular_expression}}

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to configure 802.1q VLAN On NIC
  2. tail command examples in UNIX/Linux
  3. meshlabserver Command Examples
  4. ptx: command not found
  5. Shopt: Not Found [No Such File Or Directory]
  6. virt-xml-validate: command not found
  7. logwatch : command not found
  8. “git show” Command Examples
  9. dotnet build: Builds a .NET application and its dependencies
  10. diffoscope: Compare files, archives, and directories

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright