pacman-r
Remove packages from the system
TLDR
View documentation for the original command
SYNOPSIS
pacman -r
Example: pacman -r /mnt -S linux
PARAMETERS
-r
The primary option that specifies an alternative root directory for all subsequent pacman operations. All paths accessed by pacman (configuration, databases, package installation) will be relative to this root.
--root
Long form equivalent of -r, also specifies an alternative root directory for pacman operations.
[operation]
Any standard pacman operation, such as -S (sync/install), -R (remove), -Q (query), -U (upgrade local package), etc. These operations are performed relative to the specified root.
[options]
Additional pacman options that modify the behavior of the operation (e.g., --noconfirm, --cachedir, --config). These options also apply relative to the alternative root.
[targets]
The specific packages or package groups to act upon, relative to the specified root. For example, a package name for installation or removal.
DESCRIPTION
pacman is the official package manager for Arch Linux and its derivatives. The -r or --root option allows users to perform package management operations (such as installing, removing, or querying packages) on a system root other than the currently running one. This feature is invaluable for various administrative and recovery tasks, including:
System Recovery: Managing a broken system by booting from a live environment and using pacman -r to fix issues in the installed system.
Chroot Environments: Installing or updating packages within a chroot, which is a common practice for building software, testing, or performing system maintenance in an isolated environment.
Parallel Installations: Administering multiple Arch Linux installations from a single running system.
When used, pacman will search for its configuration files (e.g., pacman.conf) and package databases within the specified root directory, rather than the standard / path. This powerful capability ensures precise control over where packages are installed and from which system's perspective the operation is performed, making it a critical tool for advanced Arch Linux users and administrators.
CAVEATS
When using pacman -r, it is crucial to ensure that the specified root directory (
CONFIGURATION FILES AND DATABASE LOCATION
When pacman -r is invoked, it specifically looks for its configuration file at
HISTORY
pacman was created by Judd Vinet and first released in 2002 as the core package manager for Arch Linux, emphasizing simplicity, speed, and reliability. The --root (or -r) option has been a fundamental part of pacman since its early development. This capability reflects the critical need for robust system recovery and management outside of a fully operational live environment, which is a common scenario in system administration. Its importance has grown significantly with the widespread adoption of chroot environments for software development, testing, and system maintenance tasks within the Arch Linux community.
SEE ALSO
pacman(8), chroot(1), arch-chroot(8)