LinuxCommandLibrary

pacrepairdb

Repair pacman package database

TLDR

Perform a basic repair on a specific package

$ pacrepairdb [package_name]
copy

Update the database entries without extracting or removing any packages
$ pacrepairdb [package_name] --dbonly
copy

Display the packages to be repaired and the cache packages to be used without making any changes
$ pacrepairdb [package_name] --print-only
copy

Display additional progress and debug information
$ pacrepairdb [package_name] --verbose
copy

Display help
$ pacrepairdb --help
copy

Display version
$ pacrepairdb --version
copy

SYNOPSIS

pacrepairdb [-q] [-r] [-f] [package ...]

PARAMETERS

-q, --quiet
    Produce minimal output

-r, --rebuild-db
    Rebuild package database after repairs

-f, --force
    Force reinstall even if files seem correct

DESCRIPTION

pacrepairdb is a utility for Arch Linux that fixes discrepancies between the local Pacman package database and filesystem. It detects packages with missing files, incorrect checksums, ownership, or permissions using pacman -Dk, then reinstalls them to restore integrity.

By default, it checks all explicitly installed packages. Specify packages on the command line to limit scope. Ideal for recovering from manual file changes, disk issues, or interrupted updates.

Requires root privileges and may download packages unless cached locally. Outputs progress and issues found; use with caution on customized systems to avoid overwriting modifications.

CAVEATS

Requires root; downloads packages if not cached; may overwrite user modifications; test on specific packages first.

EXAMPLES

Repair all explicit packages:
sudo pacrepairdb

Specific packages:
sudo pacrepairdb firefox

Force and rebuild:
sudo pacrepairdb -rf

HISTORY

Added to pacman-contrib ~2018; maintains Pacman database hygiene as Arch evolves.

SEE ALSO

pacman(8), pacman-key(8), pacman-db-upgrade(8)

Copied to clipboard