Arch Linux: Package Manager

30th July 2019 at 10:01pm
Arch Linux Linux: Package Manager

pacman

Reference

Remove all the cached packages that are not currently installed:

pacman -Sc

Remove all the cache:

pacman -Scc

Clean the cache automatically after pacman transactions:

# /etc/pacman.d/hooks/remove_cache_packages.hook
[Trigger]
Operation = Remove
Operation = Install
Operation = Upgrade
Type = Package
Target = *

[Action]
Description = Keep the last cache and the currently installed.
When = PostTransaction
Exec = /usr/bin/paccache -rvk2

yay

yay 表示 yet another yaourt,是个用 go 写的程序。

Install

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg
sudo pacman -U yay-*.tar.xz

Usage

Examples here.

Present package-installation selection menu:

yay <Search Term>

Upgrade All AUR Packages:

yay -Syu --aur --noconfirm --sudoloop

Print system statistics:

yay -Ps

Clean unneeded dependencies:

yay -Yc