← 返回命令列表

Linux command

pacman-u 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

tldr pacman upgrade

Install a local package file

sudo pacman -U [package.pkg.tar.zst]

Install multiple local packages

sudo pacman -U [*.pkg.tar.zst]

Install a package from a URL

sudo pacman -U [https://example.com/package.pkg.tar.zst]

Downgrade from the pacman cache

sudo pacman -U [/var/cache/pacman/pkg/package-oldver-x86_64.pkg.tar.zst]

Install without dependency version checks

sudo pacman -Udd [package.pkg.tar.zst]

说明

pacman -U (long form `--upgrade`) installs or upgrades a package from a local package file or URL, bypassing the configured repositories. This is how you install locally built packages (from `makepkg`/AUR helpers), downgrades from the cache, and packages downloaded by hand. Unlike `-S`, which resolves names against the sync databases, `-U` operates directly on a `.pkg.tar.zst` (or `.pkg.tar.xz`, `.pkg.tar.gz`) file. Dependencies are still resolved against the sync databases, so a full refresh via `pacman -Sy` first is often advisable.

FAQ

What is the pacman-u command used for?

pacman -U (long form `--upgrade`) installs or upgrades a package from a local package file or URL, bypassing the configured repositories. This is how you install locally built packages (from `makepkg`/AUR helpers), downgrades from the cache, and packages downloaded by hand. Unlike `-S`, which resolves names against the sync databases, `-U` operates directly on a `.pkg.tar.zst` (or `.pkg.tar.xz`, `.pkg.tar.gz`) file. Dependencies are still resolved against the sync databases, so a full refresh via `pacman -Sy` first is often advisable.

How do I run a basic pacman-u example?

Run `tldr pacman upgrade` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more pacman-u examples?

This page includes 6 examples for pacman-u, plus related commands for nearby Linux tasks.