Install and configure localepurge package, which provides a fancy shell script to recover disk space used by useless localizations.

Install the required software

Update package index.

$ sudo apt-get update

Install localepurge utility.

$ sudo apt-get install localepurge

The initial configuration will start right away.

Perform initial configuration

You can start the configuration by executing the following command.

$ sudo dpkg-reconfigure localepurge

Select locales to be kept in the system.

Decide if you want to use localepurge during package installation (dpkg operations).

Decide if you want to delete localized manual pages. This option affects dpkg operations and standalone execution as well.

Additional notes

Use /etc/locale.gen file to preselect locales to be kept the system on the first configuration run.

It is up to you to use localepurge during dpkg operations or as a standalone utility.

If you decided to use localepurge during dpkg operations, then it will create /etc/dpkg/dpkg.cfg.d/50localepurge configuration file. This file’s contents will differ depending on whether you chose to remove or leave the localized manual pages.

$ cat /etc/dpkg/dpkg.cfg.d/50localepurge
# DO NOT MODIFY/REMOVE THIS FILE - IT IS AUTO-GENERATED
#
# To remove/disable this, run dpkg-reconfigure localepurge
# and say no to/disable the "Use dpkg --path-exclude" option.
#
# To change what patterns are affected use:
# * dpkg-reconfigure localepurge
#   (to alter which locales are kept and whether manpages should
#    be purged)
# * Add a dpkg config file in /etc/dpkg/dpkg.cfg.d that is read
#   after this file with the necessary --path-include and
#   --path-exclude options.
#
# Report faulty patterns against the localepurge package.
#

# Paths to purge
path-exclude=/usr/share/locale/*
path-exclude=/usr/share/gnome/help/*/*
path-exclude=/usr/share/doc/kde/HTML/*/*
path-exclude=/usr/share/omf/*/*-*.emf
path-exclude=/usr/share/man/*
# Paths to keep
path-include=/usr/share/locale/locale.alias
path-include=/usr/share/locale/pl/*
path-include=/usr/share/locale/pl_PL/*
path-include=/usr/share/locale/pl_PL.UTF-8/*
path-include=/usr/share/gnome/help/*/C/*
path-include=/usr/share/gnome/help/*/pl/*
path-include=/usr/share/gnome/help/*/pl_PL/*
path-include=/usr/share/gnome/help/*/pl_PL.UTF-8/*
path-include=/usr/share/doc/kde/HTML/C/*
path-include=/usr/share/doc/kde/HTML/pl/*
path-include=/usr/share/doc/kde/HTML/pl_PL/*
path-include=/usr/share/doc/kde/HTML/pl_PL.UTF-8/*
path-include=/usr/share/omf/*/*-pl.emf
path-include=/usr/share/omf/*/*-pl_PL.emf
path-include=/usr/share/omf/*/*-pl_PL.UTF-8.emf
path-include=/usr/share/omf/*/*-C.emf
path-include=/usr/share/locale/languages
path-include=/usr/share/locale/all_languages
path-include=/usr/share/locale/currency/*
path-include=/usr/share/locale/l10n/*
path-include=/usr/share/man/pl/*
path-include=/usr/share/man/pl_PL/*
path-include=/usr/share/man/pl_PL.UTF-8/*
path-include=/usr/share/man/man[0-9]/*

The essential configuration is stored in /etc/locale.nopurge.

$ cat /etc/locale.nopurge 
####################################################
# This is the configuration file for localepurge(8).
####################################################

####################################################
# Uncommenting this string enables the use of dpkg's
# --path-exclude feature.  In this mode, localepurge
# will configure dpkg to exclude the desired locales
# at unpack time.
#
# If enabled, the following 3 options will be
# disabled:
#
#  QUICKNDIRTYCALC
#  SHOWFREEDSPACE
#  VERBOSE
#
# And the following option will be enabled and cannot
# be disabled (unless USE_DPKG is disabled):
#
#  DONTBOTHERNEWLOCALE
#

USE_DPKG
####################################################

####################################################
# Uncommenting this string enables removal of localized 
# man pages based on the configuration information for
# locale files defined below:

MANDELETE

####################################################
# Uncommenting this string causes localepurge to simply delete
# locales which have newly appeared on the system without
# bothering you about it:

DONTBOTHERNEWLOCALE

####################################################
# Uncommenting this string enables display of freed disk
# space if localepurge has purged any superfluous data:

SHOWFREEDSPACE

#####################################################
# Commenting out this string enables faster but less
# accurate calculation of freed disk space:

#QUICKNDIRTYCALC

#####################################################
# Commenting out this string disables verbose output:

#VERBOSE

#####################################################
# Following locales won't be deleted from this system
# after package installations done with apt-get(8):

pl
pl_PL
pl_PL.UTF-8

In case of emergency

Use the following command to re-create the manual page index cache.

$ sudo mandb -c

Use the following shell script after disabling localepurge to reinstall packages and fix missing locales.

$ cat /usr/share/doc/localepurge/reinstall_debs.sh
#/bin/sh

apt-get -u --reinstall --fix-missing install $(dpkg -S LC_MESSAGES | cut -d: -f1 | tr ', ' '\n' | sort -u)