Page 1 of 1

Reclaim disk space with localepurge

Posted: 11 Mar 2013 18:55
by ane champenois
Especially for people (like me) who don't have a brand new model of PC :D

Localepurge removes unneeded locales (there are the translations and man pages in languages that you don't speak...or you don't want), because lots of languages are installed by default when you install a new package.
Warning: it is said that it could provoke some problems with the administration of the system. But as far as I'm concerned (not-a-so-newbie) , I never had a problem within the 3 years I usually install it.
At the first time I use localepurge on a machine, it brings me lots of place (115 Mo for me!)

Installing localepurge:
In your terminal, you enter:

Code: Select all

 sudo apt-get install localepurge
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
Les NOUVEAUX paquets suivants seront installés :
  localepurge
0 mis à jour, 1 nouvellement installés, 0 à enlever et 1 non mis à jour.
Il est nécessaire de prendre 0 o/45,9 ko dans les archives.
Après cette opération, 88,1 ko d'espace disque supplémentaires seront utilisés.
Préconfiguration des paquets...
Sélection du paquet localepurge précédemment désélectionné.
(Lecture de la base de données... 162241 fichiers et répertoires déjà installés.)
Dépaquetage de localepurge (à partir de .../localepurge_0.6.3_all.deb) ...
Traitement des actions différées (« triggers ») pour « man-db »...
Paramétrage de localepurge (0.6.3) ...
Next you have to configure localepurge by deciding which languages you want to keep.
For your security, it's better to keep at least english and your native langage (of course you can add other languages :) )
They are mentioned in 2 letters codes (eg: "en" for english, "fr" for french, ...) like this:
Image
Go with the "arrow keys"up and/or down to your language and use the "space bar" to select it.They are selected with a [*] / not selected with a [ ] as you can see. It's better to select all the entries of our native language. For exemple in French (coded by "fr"):
fr
fr_FR
fr_FR@euro
fr_FR.UTF-8

And always:
en
en_US
en_US.ISO-8859-15
en_US.UTF-8
...to keep english too in every case.

After that, localepurge will run and remove all locale file that are installed. Every time you install a new package, localepurge will run automatically without any intervention.

Uninstalling localepurge
If you want to get back languages, you need to remove the package localepurge.
Write in your terminal:
sudo apt-get purge localepurge
...and follow the instructions given into your terminal to bring back the packages (I put you there these instructions):
To reinstall all the packages which localepurge has been taking care
of before, you can use the following command:

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

For your further usage, the file "/var/tmp/reinstall_debs.sh"
contains an enhanced version of the command line printed out above.
Ane