You are not logged in.

#1 2009-08-22 10:56:37

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

removing unneeded locale dirs

I have a number of different locales in /usr/share/locale and would like to remove them, for example (using ncdu):

--- /usr/share/locale -----------------------------------------------------------------------------------
           /..                                                                                           
    8.8MB  /ru
    8.7MB  /fr
    8.4MB  /de
    8.2MB  /es
    7.9MB  /sv
    7.2MB  /nl
    7.1MB  /pl
    6.9MB  /ja
    6.8MB  /uk
    6.7MB  /zh_CN
    6.6MB  /it
    6.6MB  /tr
    6.4MB  /vi
    6.2MB  /hu
    6.1MB  /bg
    5.9MB  /pt_BR
    5.8MB  /ca
    5.8MB  /cs
 Total disk usage: 364.2MB  Apparent size: 344.2MB  Items: 10258

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2009-08-22 13:12:38

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: removing unneeded locale dirs

Hi "graysky"

I think I have just the app your looking for! It's called "localepurge" and you can find it in AUR.

http://aur.archlinux.org/packages.php?ID=11975

You need to make sure you set up the the configuration file located at:

/etc/locale.nopurge

It looks like this:

####################################################
# This is the configuration file for localepurge(8).
####################################################
# Comment this to enable localepurge.
# NO COMMENT IT IF YOU ARE NOT SURE WHAT ARE YOU DOING
# THIS APP DO NOT ASK FOR CONFIRMATION

#NEEDSCONFIGFIRST

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

MANDELETE

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

SHOWFREEDSPACE

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

VERBOSE

#####################################################
# You like Colors?

#NOCOLOR

#####################################################
# You can use the -v -d -nc options in command linei.

#####################################################
# Following locales won't be deleted from this system
# for example:
en
en_GB
es
es_ES
es_ES@euro
es_ES.UTF-8

Make sure to comment out this line for localepurge to work (also mentioned in the conf. file).

From this:

Comment this to enable localepurge.

To this:

#Comment this to enable localepurge.

At the bottom of the conf. file you need to set up the locales you don't want purged. The script is defaulted for English locales. If your running only in English then just comment out the line and you will be good otherwise make sure to add/change the locales to your specific language(s) you want to keep.

Note: You might or might not want to keep the "de" locales (I believe those are the ones!!) in case you ever want to build gcc from ABS. Actually I just checked and this is the message you will see if you try to build gcc.

You need the de_DE locale to build gcc.

Once set up just run the command:

localepurge

It's good to do this after you update/install programs as they will reload that stuff.

Also, off topic, but if your trying to minimize your disk space usage and you build your own programs then setting the "doc" variable in /etc/makepkg.conf to "!doc" will keep most of the doc files from installing as well. That is if you don't use the doc files of course otherwise leave them alone.

Good Luck!


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

#3 2023-02-08 20:17:19

jm_123
Member
Registered: 2022-10-20
Posts: 2

Re: removing unneeded locale dirs

harryNID wrote:

Hi "graysky"
From this:

Comment this to enable localepurge.

To this:

#Comment this to enable localepurge.

That's not the line to comment/uncomment. To enable, you have to do this:

From this:

NEEDSCONFIGFIRST

To this:

#NEEDSCONFIGFIRST

Offline

#4 2023-02-08 20:22:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,645

Re: removing unneeded locale dirs

Please pay attention to the date, you are replying to a 13 year old thread.

Don't necrobump: https://wiki.archlinux.org/title/Genera … bumping%22

Closing.

Offline

Board footer

Powered by FluxBB