System maintenance
Table of Contents
https://wiki.archlinux.org/title/System_maintenance
Update
System packages
To check packages to update:
paru -Qu
And then to perform the update:
paru
NPM
First update npm
itself
sudo npm install npm@latest -g
Then, we can list outdated packages:
npm outdated -g --depth=0
And finally perform the update:
sudo npm update -g
PIP
First upgrade pip
itself:
/usr/bin/python3 -m pip install --upgrade pip
Then list outdated packages:
pip3 list --outdated
And update everything with:
pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
Emacs and Vim
Update Doom emacs with:
doom up
And Vim packages with:
nvim -c PlugUpgrade -c PlugUpdate
Check problems in the system
First check for failed services:
systemctl --failed
Same for user services:
systemctl --user --failed
Look for errors in the logs:
sudo journalctl -p 3 -b
Check orphan and dropped packages
Run the following to list all orphan packages:
pacman -Qtdq | fzf --preview 'pacman -Qil {}' --layout=reverse --bind 'enter:execute(pacman -Qil {} | less)'
Then, either remove the unused packages or set the package to “explicitly installed” with:
sudo pacman -D --asexplicit package_name
Use the ancient-packages
(link) command to list dropped packages (packages may longer in the remote repositories, but still on the local system):
ancient-packages