• 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. pvresize Command Examples in Linux
  2. coffee: Executes CoffeeScript scripts or compiles them into JavaScript
  3. deluge: A command-line BitTorrent client
  4. grub-install: command not found
  5. Yum Command Fails with “Another app is currently holding the yum lock” in CentOS/ RHEL 7
  6. clamscan: A command-line virus scanner
  7. aspell: command not found
  8. aws backup: Unified backup service designed to protect Amazon Web Services services and their associated data
  9. How to enable text colour in vi similar to vim in CentOS/RHEL
  10. How to Check if a Service Restart or Server Reboot is required After RPM Package Update (CentOS/RHEL/Fedora)

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright