pacman –files Command Examples

“pacman –files” is an option for the pacman package manager in Arch Linux and its derivatives. It allows the user to display a list of all the files installed by a given package. The output of this option provides information about the package’s files, including the file names, file paths, and the package that installed each file.

This option can be useful for several reasons, such as:

  • Verifying the contents of a package: By using “pacman –files”, the user can see exactly what files were installed by a package, which can be useful in verifying that a package was installed correctly.
  • Finding the source of a file: If a file on the system cannot be found, “pacman –files” can be used to determine which package installed it, so the user can install the corresponding package to restore the missing file.
  • Checking for package upgrades: By using “pacman –files” before and after an upgrade, the user can compare the lists of files installed by a package and see if any new files were added or any old files were removed, indicating a change in the package.

pacman –files Command Examples

1. Update the package database:

# sudo pacman --files --refresh

2. Find the package that owns a specific file:

# pacman --files {{filename}}

3. Find the package that owns a specific file, using a regular expression:

# pacman --files --regex '{{regular_expression}}'

4. List only the package names:

# pacman --files --quiet {{filename}}

5. List the files owned by a specific package:

# pacman --files --list {{package_name}}

6. List only the absolute path to the files:

# pacman --query --list --quiet {{package_name}}

7. Display help:

# pacman --files --help
Related Post