LinuxCommandLibrary

pacman-u

Upgrade installed packages

TLDR

View documentation for the original command

$ tldr pacman upgrade
copy

SYNOPSIS

pacman -U <package_file> ...
pacman --upgrade <package_file> ...
Note: <package_file> refers to the path to one or more .pkg.tar.zst files or remote URLs.

PARAMETERS

--force
    Force install/upgrade, overwriting conflicting files. Use with caution.

--needed
    Do not reinstall the target if it is already installed and up-to-date.

--noconfirm
    Do not ask for confirmation during the installation process.

--asdeps
    Install packages as dependencies, marking them as implicitly installed.

--asexplicit
    Install packages explicitly, marking them as intentionally installed by the user.

--cachedir <dir>
    Set an alternate package cache location for downloaded packages.

--dbpath <path>
    Set an alternate database location for pacman's package information.

--root <path>
    Set an alternate installation root directory.

--config <file>
    Set an alternate configuration file for pacman.

--sysroot <path>
    Operate on a different system root, similar to --root but also adjusts other paths.

--overwrite <glob>
    Bypass file conflict checks and allow pacman to overwrite files matching the specified <glob> pattern.

DESCRIPTION

The pacman -U (or --upgrade) command in Arch Linux is used to install or upgrade packages from a specified local package file (typically with a .pkg.tar.zst extension) or a remote URL. Unlike pacman -S which fetches packages from configured repositories, -U operates directly on a provided package file.

This is particularly useful for installing packages built locally using makepkg, installing development versions, or downgrading a package to a specific version you have on hand. It will attempt to resolve dependencies if they are already installed or provided by other specified local package files, but it does not automatically fetch missing dependencies from repositories.

CAVEATS

  • Requires the package file to be present locally or accessible via URL.
  • Does not automatically fetch missing dependencies from configured repositories. You must ensure all dependencies are met, either by installing them beforehand or by providing their package files in the same command.
  • Careless use, especially with --force or incompatible packages, can lead to system instability or breakage.
  • Always verify the source and integrity of .pkg.tar.zst files before installing them.

DEPENDENCY HANDLING

When using pacman -U, if a package has unsatisfied dependencies, pacman will report an error. You must either install those dependencies from repositories using pacman -S first, or include their respective package files in the same pacman -U command.

DOWNGRADING PACKAGES

To downgrade a package, simply use pacman -U with an older version of the .pkg.tar.zst file. If newer versions are present and cause conflicts, you might need to use --overwrite to handle file conflicts or remove the newer version first using pacman -R.

HISTORY

pacman (Package Manager) was developed by Judd Vinet, the founder of Arch Linux, and first released in 2002. It was designed to be a simple, fast, and efficient package manager. The -U (upgrade/install local) functionality has been a core part of pacman since its early versions, crucial for allowing users to install self-compiled packages or specific versions outside of the main repositories, complementing the repository-based installation (-S). Its continued development by the Arch Linux community has seen numerous improvements in dependency resolution, file handling, and performance.

SEE ALSO

pacman(8), pacman-S(8), pacman-R(8), makepkg(8), pactree(8)

Copied to clipboard