Pi-TV

# Arch Linux, Cleanup, df, du, find, pacman 2022-02-02

Linux cleanup

Disk space matters.

Linux includes a lot of redundant files. For example, as a German - do you need man files, locales or documents in Japanese? In most cases the answer is No.

Analyze disk usage

Before cleanup, you need to know what and how much it occupies the space. These commands can help:

Cleanup boot

rm /boot/initramfs-linux-fallback.img

Cleanup mans

(cd /usr/share/man && find ! -path "./man*" -delete)

Get rid of mandb

systemctl disable man-db
rm -rf /var/cache/man

Cleanup locales

(cd /usr/share/locale && find ! -path "./en_US*" ! -path "./en_GB*" ! -path "./en@*" -delete)
(cd /usr/share/i18n/locales && find ! -name "POSIX" ! -name "en_US" -delete)

Cleanup docs

rm -rf /usr/share/doc
rm -rf /usr/share/info
rm -rf /usr/share/gtk-doc

Clear pacman cache

pacman -Scc