← 返回命令列表

Linux command

pacman-d 命令

安全

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

常用示例

Mark a package as installed as a dependency

sudo pacman -D --asdeps [package]

Mark a package as explicitly installed

sudo pacman -D --asexplicit [package]

Check the local database for consistency

pacman -Dk

Check local and sync databases for consistency

pacman -Dkk

Check in quiet mode

pacman -Dkq

说明

pacman -D is the short form of pacman --database, which operates on the package database. It allows modifying package attributes stored in the local database without reinstalling packages. The most common use is changing a package's install reason between dependency and explicit. Packages marked as dependencies may be removed by `pacman -Rs` when no other packages depend on them, while explicitly installed packages are kept.

参数

--asdeps
Mark packages as installed as dependencies. Affects orphan detection.
--asexplicit
Mark packages as explicitly installed. Prevents removal when cleaning orphans.
-k, --check
Check the local package database for internal consistency. Use twice (`-kk`) to also check sync databases.
-q, --quiet
Suppress messages on successful completion; only show errors.

FAQ

What is the pacman-d command used for?

pacman -D is the short form of pacman --database, which operates on the package database. It allows modifying package attributes stored in the local database without reinstalling packages. The most common use is changing a package's install reason between dependency and explicit. Packages marked as dependencies may be removed by `pacman -Rs` when no other packages depend on them, while explicitly installed packages are kept.

How do I run a basic pacman-d example?

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

What does --asdeps do in pacman-d?

Mark packages as installed as dependencies. Affects orphan detection.