man localepurge (Administration système) - removing superfluous locale data


localepurge - removing superfluous locale data




localepurge is a small script to recover disk space wasted for unneeded locale files and localized man pages. It will be automagically invoked by dpkg upon completion of any apt installation run. You have to define the locale directory names you want to keep from removal after each apt installation run in the /etc/locale.nopurge configuration file. Unless localepurge has been adequately configured, the system's locale directories won't be touched at all.

Any other directory (or file) in /usr/share/locale not containing a subdirectory named LC_MESSAGES will be discreetly ignored.


The configurable options consist of toggling verbose output, reporting a summary of freed space, and deletion of localized manual pages in addition to locale files. All actions are specified in the /etc/locale.nopurge configuration file. Since localepurge uses debconf for storing its configuration data its configuration should only be done via dpkg-reconfigure(8) as outlined below. If not done via debconf(8) any manual entries will be irreversibly lost after an upgrade or reinstallation of the package.

For detailed debugging the commandline switch -debug or just a short -d instead are available for usage. For verbose output the commandline switch -verbose or just a short -v can be added.


Please note, that this tool is a hack which is not integrated with Debian's package management system and therefore is not meant for the faint of heart. Responsibility for its usage and possible breakage of your system therefore lies in the sysadmin's (your) hands.

Please definitely do abstain from reporting any bugs blaming localepurge if you break your system by using it. If you don't know what you are doing and can't handle any resulting breakage on your own then please simply don't use it.

All locale directories containing a subdirectory named LC_MESSAGES which are either commented out or not even listed at all in /etc/locale.nopurge will be irreversibly deleted. The only way to reinstall any lost locales is a complete reinstallation of all the Debian packages containing them. See /usr/share/doc/localepurge/ for a recipe. Alternatively you can reconfigure it with dpkg-reconfigure(8) to prevent locale files from being purged during subsequent runs of apt.

The localepurge configuration should only be configured by using the command 'dpkg-reconfigure localepurge' to add/remove locale entries or toggle verbosity. Since localepurge is using the debconf(8) facility for storing its configuration entries it shouldn't be configured manually because all manual entries will get lost after upgrade, reconfiguration or reinstallation of localepurge.

SOLVING PROBLEMS caused by localepurge

This program does interfere with the Debian package management and does provoke strange, but usually harmless, behaviour of programs related with apt/dpkg like dpkg-repack(1), debsums(1), reportbug(1), etc. If you need to have any package in its full integrity so that e.g. the formerly mentioned programs work as designed by its author and as expected by you, simply deinstall localepurge temporarily without purging its configuration and reinstall the packages you need in their fully integral state. When you are done with what you needed the integral packages for simply reinstall localepurge again.




Administrators of systems with short disk space should have a look at both the deborphan and debfoster packages. Especially debfoster can work wonders for your scarce disk space!








localepurge and its accompanying manual page was written for the Debian GNU/Linux system by Paul Seelig <> with major contributions from Gustavo Noronha Silva <> who added the first debconf functionality. The author sincerely hopes that some day further development of Debian's great package management system will make localepurge fully obsolete.