Request: An option to install only the locales we need
Posted: Sat Jun 07, 2025 2:04 am
This will kill two birds with one stone:
For those interested in numbers, this is what I uncovered on my system:
After installing and running localepurge and then running updatedb (from the plocate package), this was the result:
From what I understand from reading the localepurge docs, the above 412MB will come down as packages are updated. Of course, if the request can be implemented, those would not be installed on new installations.
[Edited to add localepurge's output]
As you can see, it's not just the space (and inodes) under /usr/share/locale.
Not that I think it's necessary in this case, but here we go:
- We'll only see "Generating locales (this might take a while)..." for the locales we use, making that process FAR quicker to complete. This already happens when you choose only the locales you use when you run dpkg-reconfigure locales, but it doesn't change the space used by all the locale information.
- We'll save a lot of space under /usr/share/locale and possibly elsewhere as well, depending on how it's done. You can stop .deb packages from installing locale-related files such as all the translations they have for the package. Seeing how the localepurge package does it should help.
For those interested in numbers, this is what I uncovered on my system:
Code: Select all
$ du -sh /usr/share/locale
544M /usr/share/locale
$ locate -i /locale | grep -v flatpak | wc -l
21599
$ locate -i /locale | grep -v flatpak | tr \\n \\0 | du -shc0 --files0-from - | tr \\0 \\n | tail -1
926M total
Code: Select all
$ du -sh /usr/share/locale
32M /usr/share/locale
$ locate -i /locale | grep -v flatpak | wc -l
7294
$ locate -i /locale | grep -v flatpak | tr \\n \\0 | du -shc0 --files0-from - | tr \\0 \\n | tail -1
412M total
[Edited to add localepurge's output]
Code: Select all
localepurge: Disk space freed: 523864 KiB in /usr/share/locale
localepurge: Disk space freed: 9716 KiB in /usr/share/man
localepurge: Disk space freed: 1128 KiB in /usr/share/gnome/help
localepurge: Disk space freed: 320 KiB in /usr/share/tcltk
localepurge: Disk space freed: 1560 KiB in /usr/share/cups/templates
localepurge: Disk space freed: 3292 KiB in /usr/share/cups/locale
localepurge: Disk space freed: 20 KiB in /usr/share/cups/doc-root
localepurge: Disk space freed: 4528 KiB in /usr/share/aptitude
localepurge: Disk space freed: 0 KiB in /usr/share/cups/templates
localepurge: Disk space freed: 0 KiB in /usr/share/cups/locale
localepurge: Disk space freed: 0 KiB in /usr/share/cups/doc-root
localepurge: Disk space freed: 28608 KiB in /usr/share/help
localepurge: Disk space freed: 4680 KiB in /usr/share/vim/vim82/lang
Total disk space freed by localepurge: 577716 KiB
Not that I think it's necessary in this case, but here we go:
Code: Select all
System: Kernel: 6.0.0-10.1-liquorix-amd64 [6.0-6~mx21+1] x86_64 bits: 64 compiler: gcc v: 10.2.1
parameters: audit=0 intel_pstate=disable hpet=disable rcupdate.rcu_expedited=1
BOOT_IMAGE=/vmlinuz-6.0.0-10.1-liquorix-amd64 root=UUID=<filter> ro consoleblank=300
threadirqs init=/lib/systemd/systemd
Desktop: Xfce 4.18.1 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.18.0 vt: 7
dm: LightDM 1.26.0 Distro: Debian GNU/Linux 11 (bullseye)
base: Debian GNU/Linux 11 (bullseye)
Machine: Type: Laptop System: Dell product: Latitude E6530 v: 01 serial: <filter> Chassis:
type: 9 serial: <filter>
Mobo: Dell model: 0JC5MT v: A01 serial: <filter> BIOS: Dell v: A22 date: 11/30/2018
Battery: ID-1: BAT0 charge: 26.7 Wh (100.0%) condition: 26.7/73.3 Wh (36.4%) volts: 11.6
min: 11.1 model: SMP DELL N4FJ513 type: Li-ion serial: <filter> status: Full
CPU: Info: Dual Core model: Intel Core i7-3520M bits: 64 type: MT MCP arch: Ivy Bridge
family: 6 model-id: 3A (58) stepping: 9 microcode: 21 cache: L2: 4 MiB
flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23123
Speed: 2890 MHz min/max: N/A Core speeds (MHz): 1: 2890 2: 2890 3: 2890 4: 2890
Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled
Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
Type: mds mitigation: Clear CPU buffers; SMT vulnerable
Type: meltdown mitigation: PTI
Type: mmio_stale_data status: Unknown: No mitigations
Type: retbleed status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP:
conditional, RSB filling, PBRSB-eIBRS: Not affected
Type: srbds status: Vulnerable: No microcode
Type: tsx_async_abort status: Not affected
Graphics: Device-1: Intel 3rd Gen Core processor Graphics vendor: Dell driver: i915 v: kernel
bus-ID: 00:02.0 chip-ID: 8086:0166 class-ID: 0300
Device-2: Microdia Integrated Webcam type: USB driver: uvcvideo bus-ID: 1-1.5:4
chip-ID: 0c45:648b class-ID: 0e02
Display: x11 server: X.Org 1.20.14 compositor: xfwm4 v: 4.18.0 driver:
loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1
Screen-1: 0 s-res: 3520x1200 s-dpi: 96 s-size: 931x317mm (36.7x12.5")
s-diag: 983mm (38.7")
Monitor-1: LVDS-1 res: 1920x1080 hz: 60 dpi: 142 size: 344x194mm (13.5x7.6")
diag: 395mm (15.5")
Monitor-2: VGA-1 res: 1600x1200 hz: 60 dpi: 111 size: 367x275mm (14.4x10.8")
diag: 459mm (18.1")
OpenGL: renderer: Mesa Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 22.0.5
compat-v: 3.1 direct render: Yes
Audio: Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Dell
driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20 class-ID: 0403
Sound Server-1: ALSA v: k6.0.0-10.1-liquorix-amd64 running: yes
Sound Server-2: JACK v: 1.9.21 running: no
Sound Server-3: PulseAudio v: 14.2 running: yes
Sound Server-4: PipeWire v: 0.3.19 running: no
Network: Device-1: Intel 82579LM Gigabit Network vendor: Dell driver: e1000e v: kernel
port: f080 bus-ID: 00:19.0 chip-ID: 8086:1502 class-ID: 0200
IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-2: Intel Centrino Ultimate-N 6300 driver: iwlwifi v: kernel modules: wl
port: f040 bus-ID: 02:00.0 chip-ID: 8086:422b class-ID: 0280
IF: wlp2s0 state: down mac: <filter>
Drives: Local Storage: total: 447.13 GiB used: 398.61 GiB (89.1%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: Patriot model: Burst Elite 480GB size: 447.13 GiB
block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter>
rev: 3A0 scheme: MBR
Partition: ID-1: / raw-size: 438.11 GiB size: 430.16 GiB (98.19%) used: 398.46 GiB (92.6%)
fs: ext4 dev: /dev/dm-0 maj-min: 253:0 mapped: root.fsm
ID-2: /boot raw-size: 1024 MiB size: 973.4 MiB (95.06%) used: 153.4 MiB (15.8%)
fs: ext4 dev: /dev/sda1 maj-min: 8:1
Swap: Kernel: swappiness: 10 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: partition size: 7.98 GiB used: 0 KiB (0.0%) priority: -2
dev: /dev/dm-1 maj-min: 253:1 mapped: swap
Sensors: System Temperatures: cpu: 54.0 C mobo: 35.0 C sodimm: SODIMM C
Fan Speeds (RPM): cpu: 0
Repos: Packages: 3505 note: see --pkg apt: 3451 lib: 1869 flatpak: 54
No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
Active apt repos in: /etc/apt/sources.list.d/debian.list
1: deb http://deb.debian.org/debian bullseye main contrib non-free
2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
3: deb http://deb.debian.org/debian bullseye-backports main contrib non-free
Active apt repos in: /etc/apt/sources.list.d/kopia.list
1: deb [signed-by=/etc/apt/keyrings/kopia-keyring.gpg] http://packages.kopia.io/apt/ stable main
Active apt repos in: /etc/apt/sources.list.d/mx.list
1: deb http://ftp.cc.uoc.gr/mirrors/linux/mx/mx/repo/ bullseye main non-free
2: deb http://ftp.cc.uoc.gr/mirrors/linux/mx/mx/repo/ bullseye ahs
Active apt repos in: /etc/apt/sources.list.d/signal-xenial-added-by-mxpi.list
1: deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main
Active apt repos in: /etc/apt/sources.list.d/virtualbox.list
1: deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian bullseye contrib
Active apt repos in: /etc/apt/sources.list.d/webmin.list
1: deb [signed-by=/usr/share/keyrings/debian-webmin-developers.gpg] https://download.webmin.com/download/newkey/repository stable contrib
Active apt repos in: /etc/apt/sources.list.d/protonvpn-stable.sources
1: deb https://repo.protonvpn.com/debian stable main
Info: Processes: 307 Uptime: 4h 45m wakeups: 2 Memory: 7.68 GiB used: 4.69 GiB (61.1%)
Init: systemd v: 247 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: 10.2.1
alt: 10 Client: shell wrapper v: 5.1.4-release inxi: 3.3.06
Boot Mode: BIOS (legacy, CSM, MBR)