essay | tech | year-summary | about

返回上级菜单

arch linux tips


日期:2022-06-04T00:00:00Z

Missing mirrorlist

curl -o /etc/pacman.d/mirrorlist https://archlinux.org/mirrorlist/all/
pacman -Syu pacman-mirrorlist

mirror update

/usr/bin/rankmirrors

update

keys & update system

pacman -Sy --needed archlinux-keyring && pacman -Su

https://wiki.archlinux.org/title/Pacman/Package_signing#Upgrade_system_regularly

rm -r /etc/pacman.d/gnupg
pacman-key --init && pacman-key --populate

force

pacman -Syyu

update

pacman -Syu

common

pacman -Syu <pkg> 	Install (and update package list)
pacman -S <pkg> 	Install only
pacman -Rsc <pkg> 	Uninstall
pacman -Ss <keywords> 	Search
pacman -Syu 	Upgrade everything

query

pacman -Qe 	List explictly-installed packages
pacman -Ql <pkg> 	What files does this package have?
pacman -Qii <pkg> 	List information on package
pacman -Qo <file> 	Who owns this file?
pacman -Qs <query> 	Search installed packages for keywords

Orphans

pacman -Qdt 	List unneeded packages
pacman -Rns $(pacman -Qdtq) 	Uninstall unneeded packages

Avoid orphans by using pacman -Rsc to remove packages, which will remove unneeded dependencies.

Other

pactree <pkg> 	What does pkg depend on?
pactree -r <pkg> 	What depends on pkg?

AUR

https://itsfoss.com/aur-arch-linux/

sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

yay -S package_name

install older packages

https://unix.stackexchange.com/questions/313474/how-do-i-list-the-available-versions-of-a-package-in-arch-linux
https://wiki.archlinux.org/title/Arch_Linux_Archive
https://archive.archlinux.org/packages/

pacman -U https://archive.archlinux.org/packages/path/packagename.pkg.tar.zst

https://wiki.archlinux.org/title/mirrors
https://wiki.archlinux.org/title/pacman
https://devhints.io/pacman