Pacman has a NoExtract option

I used to use localepurge, a script that purges unneeded locales from my system. This can free up quite a lot of space. Unfortunately the package manager then starts to complain about non-existing files.

Solution

Tell the package manager not to install these files in the first place!

An excerpt from /etc/pacman.conf:

# useless non-English manpages
NoExtract   = usr/share/locale/* !usr/share/locale/en* !usr/share/locale/locale.alias
NoExtract   = usr/share/help/* !usr/share/help/en*
NoExtract   = usr/share/man/* !usr/share/man/man*
NoExtract   = usr/lib/chromium/locales/*.pak !usr/lib/chromium/locales/en-*.pak
NoExtract   = usr/share/doc/HTML/* !usr/share/doc/HTML/en
NoExtract   = usr/share/qt6/translations/qtwebengine_locales/*.pak !usr/share/qt6/translations/qtwebengine_locales/en-*.pak
NoExtract   = usr/share/i18n/locales/* !usr/share/i18n/locales/en_* !usr/share/i18n/locales/POSIX

# Misc options
#CheckSpace

This and the necessity to comment out CheckSpace is discussed in this thread

I did run localepurge once manually for I don’t believe that the NoExtract option will delete existing files. Careful! Make sure you edit /etc/locale.nopurge first.