PACREPAIRDB(1) pacrepairdb PACREPAIRDB(1)

pacrepairdb - fix corrupted database entries

pacrepairdb [options] <package>...
pacrepairdb (--help|--version)

Attempt to repair broken package entries in libalpm's database. Any missing essential files will be created and the packages will be reinstalled from the cache.

If stdin is not connected to a terminal, package names will be read from stdin.

Set an alternate cache directory path.
Set an alternate configuration file path.
Make the changes to the database without actually extracting or removing any packages.
Set an alternate database path.
Display additional debugging information.
Add additional user hook directories.
Set an alternate log file path.
Assume default responses to all prompts.
Do not run package install scripts.
Do not run transaction hooks.
Disable low-speed timeouts for downloads.
Display the packages to be repaired and the cache packages to be used and exit.
Set an alternate installation root.
Set an alternate system root. See pacutils-sysroot(7).
Display additional progress information.
Display usage information and exit.
Display version information and exit.

Find and reinstall broken packages:

paccheck --list-broken --files --file-properties --db-files --require-mtree | pacrepairdb

pacrepairdb expects all of the packages being repaired to be cached. Cached packages that match the name and version of an installed package are assumed to be the same package. No attempt is made to validate cached packages. If a cache contains a package that does not match the installed package, but nonetheless has the same name and version, pacrepairdb will blindly install it, worsening any database problems.

pacrepairdb does not check for leftover orphaned files. It is the user's responsibility locate and handle orphaned files.

pacrepairdb determines whether or not to read package names from stdin based on a naive check using isatty(3). If pacrepairdb is called in an environment, such as a shell function or script being used in a pipe, where stdin is not connected to a terminal but does not contain package names to repair, pacrepairdb should be called with stdin closed. For POSIX-compatible shells, this can be done with "<&-".

2024-04-16 pacutils