← 返回命令列表

Linux command

pacman-remove 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Remove a package and its unneeded dependencies

sudo pacman -Rs [package]

Remove without saving config backup files

sudo pacman -Rsn [package]

Remove without prompting for confirmation

sudo pacman -R --noconfirm [package]

Remove orphan packages (unneeded dependencies)

sudo pacman -Rsn $(pacman -Qdtq)

Cascade remove a package and all packages that depend on it

sudo pacman -Rc [package]

Preview what would be removed without removing

pacman -Rp [package]

说明

pacman -R (remove) removes packages from an Arch Linux system. It can also remove dependencies, configuration files, and handle cascading removals of dependent packages.

参数

-R, --remove
Remove packages from the system.
-s, --recursive
Remove specified targets and their dependencies not required by other packages and not explicitly installed. Pass twice (-ss) to also remove explicitly installed dependencies.
-n, --nosave
Remove configuration backup files (prevents .pacsave files from being created).
-c, --cascade
Remove all target packages, as well as all packages that depend on them. This operation is recursive.
-p, --print
Print what would be removed without actually removing.
-u, --unneeded
Remove targets that are not required by any other packages. Useful when removing a group without using -c.
-d, --nodeps
Skip dependency version checks. Pass twice to skip all dependency checks.
--dbonly
Remove the database entry only, leaving all files in place.
--noscriptlet
Do not execute install scriptlet during removal.
--noconfirm
Skip confirmation prompts.

FAQ

What is the pacman-remove command used for?

pacman -R (remove) removes packages from an Arch Linux system. It can also remove dependencies, configuration files, and handle cascading removals of dependent packages.

How do I run a basic pacman-remove example?

Run `sudo pacman -Rs [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -R, --remove do in pacman-remove?

Remove packages from the system.