Package Management - Arch
Removing unused packages
List unused packages:
pacman -Qdtq
Remove all unused packages:
pacman -Qdtq | sudo pacman -Rs -
Remove multi-lib packages:
pacman -R `LANG=C pacman -Sl multilib | grep installed | cut -d ' ' -f 2`
Once done, edit /etc/pacman.conf and comment out the [multilib] section.
Re-install all packages (not AUR):
pacman -Qqn | sudo pacman -S -
Re-install all AUR packages:
yay -Sy --rebuildtree --rebuildall $(pacman -Qqme)
Use Reflector to find the fastest 20 mirrors in the specified country:
sudo reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist --country gb``
Install reflector with the pacman hook:
yay -S reflector reflector-pacman-hook-git
Edit /etc/xdg/reflector/reflector.conf to configure the reflector update.
Enable reflector to run at startup (you can also enable reflector.timer to run weekly):
sudo systemctl enable --now reflector.service