Open In App

How to Install apt-file package on Ubuntu?

Last Updated : 09 Jun, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Apt-file is a software program that indexes the contents of packages in your accessible repositories and allows you to search for a certain file among all available packages. Apt-file is a command-line utility for searching files in APT packages. You may search for which package a file is in or show the contents of a package without installing or downloading it.

In this article, we will show you how to install the apt-file tool on Ubuntu and how to use it to search for files across all available packages.

Methods to Install apt-file on Ubuntu

On Ubuntu 20.04, there are three options for installing abs-guide. Apt-get, apt, and aptitude are all available. Each strategy of installation will be described in detail in the following sections. You may select any of them.

  • Using apt-get to install  
  • Using aptitude to install  
  • Using apt to install  

Method 1: Using the apt-get command

The following are the steps you should follow to install apt-file package on ubuntu using the apt-get command:

Step 1: Using the following command, update the apt database using apt-get.

sudo apt-get update

Updating-database

Step 2: After upgrading the apt database, we can use apt-get to install abs-guide by performing the following command:

sudo apt-get -y install apt-file

111zon18-copy-2

Method 2: Using apt

The following are the steps you should follow to install apt-file package on ubuntu using apt command:

Step 1: The apt database will be updated with the command below.

sudo apt update

Updating-database

Step 2: After upgrading the apt database, we can use apt to install abs-guide package by performing the following command:

sudo apt -y install apt-file

Installing-abs-guide

Method 3: Using aptitude

The following are the steps you should follow to install apt-file package on ubuntu using aptitude command:

Step 1: If you want to use this method, you may need to install aptitude first because it is not normally installed by default on Ubuntu. Use the following command to update the apt database with aptitude.

sudo aptitude update

Updating-aptitude

Step 2: After upgrading the apt database, we can use aptitude to install abs-guide by performing the following command:

sudo aptitiude -y install apt-file

Installing-abs-guide

Examples of Apt-File on Ubuntu

Example 1: Display all Files 

Display every file in every APT package that has the word "gimp" in its name.

apt-file search gimp

File-with-gimp-name-displayed

Example 2: Matched Package Only

Carry out the same search as before, but this time simply list the names of matched packages.

apt-file --package-only search gimp

Matched-packages-list

Example 3: List Every Package

List every file with "gimp" in its name that is included in every package.

apt-file list gimp

3311zon-copy

Conclusion

The apt-file tool is a very helpful utility on Ubuntu when you need to find out which package contains a specific file or command. This can save you time and effort, especially when you're trying to solve errors caused by missing files. In this article, we showed you three different ways to install apt-file using apt-get, apt, and aptitude. You can choose the method that works best for you. We also looked at some basic examples of how to use apt-file to search for files and packages. Once installed, apt-file can make it much easier to manage and troubleshoot your Ubuntu system.It is a great tool to have in your software toolkit.


Next Article

Similar Reads