blog/source/_posts/Linux/pacman.md
2022-09-04 02:47:29 +08:00

745 B
Raw Permalink Blame History

title keywords categories tags date
pacman
Arch Linux
pacman
Linux
Arch Linux
2022-08-31 14:08:30
rankmirrors /etc/pacman.d/mirrorlist.china > /etc/pacman.d/mirrorlist

自动清理老旧的包缓存

建立一个 hook 文件在 /etc/pacman.d/hooks/clean_package_cache.hook,内容如下:

[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache...
When = PostTransaction
Exec = /usr/bin/paccache -rk3

系统会在每次安装升级卸载以后执行 /usr/bin/paccache -rk3 删除包的历史缓存仅保留最近的3个版本。