TOOL » LINUX » ARCH

Pacman

Usage

CommandDescription
pacman -SyuUpdate all packages
pacman -S packageInstall new package
pacman -Rs packageRemove a package. Add -c for cascade, -u for group of packages
pacman -Qtdq | pacman -Rns -Remove orphaned packages
pacman -QeList all packages explicitly installed
pacman -QetList all packages explicitly installed and not required as dependencies (required + optional)
pacman -QettList all packages explicitly installed and not required as dependencies (required only)
pacman -Qi packageCheck information of a package that is installed.
pacman -Si packageCheck information of a package that may not be installed.

Check packages explicitly installed but required dependency at the same time.

fish
diff -y (pacman -Qqett | psub) (pacman -Qqe | psub)

Configuration

Parallel downloads

Edit /etc/pacman.conf:

ini
ParallelDownloads = 10

Update mirrors

Mirror List Generator

Choose nearby, sort by speed and remove out-of-sync mirrors. Example command to generate a good /etc/pacman.d/mirrorlist:

shell
curl -s "https://archlinux.org/mirrorlist/?country=CN&country=JP&country=TW&protocol=https&ip_version=4&use_mirror_status=on" | \
  sed -e 's/^#Server/Server/' -e '/^#/d' | \
  rankmirrors -

AUR

shell
makepkg -sicr
OptionDescription
-sSyncronize and install dependencies with pacman
-iInstall
-cClean build files
-rRemove dependencies installed by -s