Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

MX Snappshot tool - create a small ISO -file

Help for Current Versions of MX
Message
Author
skidoo
Forum Regular
Forum Regular
Posts: 842
Joined: Tue Sep 22, 2015 6:56 pm

Re: MX Snappshot tool - create a small ISO -file

#11 Post by skidoo » Sun May 20, 2018 1:23 pm

fehlix, that one-liner is pretty slick, but I have a question: Shouldn't we also preserve the content of the "C" locale subdirectory?

Across years, I've used a very granular cleaning script & have incrementally modified it. The locales portion currently looks like this:

Code: Select all

###       preserve only "C", "en", and "en_US
###      ...and the "locale.alias" (symlink) file  ----- for now, also preserve en@* dirs
rm -Rf /usr/share/locale/[a-b]*
rm -Rf /usr/share/locale/[c-d][a-z]*
rm -Rf /usr/share/locale/e[^n]
rm -Rf /usr/share/locale/en_[^U]*
rm -Rf /usr/share/locale/[f-k]*
rm -Rf /usr/share/locale/l[^o][^c]*
rm -Rf /usr/share/locale/[m-z]*
### ^--- a single, terse pattern might be more efficient... but would be LESS READABLE
I didn't keep notes regarding which program(s) had no "en" and needed "C", but I apparently encountered some which did (some still do need these?)

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1156
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Snappshot tool - create a small ISO -file

#12 Post by fehlix » Sun May 20, 2018 1:40 pm

skidoo wrote:
Sun May 20, 2018 1:23 pm

Code: Select all

###       preserve only "C", "en", and "en_US
###      ...and the "locale.alias" (symlink) file  ----- for now, also preserve en@* dirs
rm -Rf /usr/share/locale/[a-b]*
..
I havn't touched /usr/share/locale. This I would do with bleachbit.
You would only need to keep C-locale as locale-gen will regenerate
only those from /etc/locale.gen. Here we go:

Code: Select all

# sudo rm -r $( ls -d1 /usr/lib/locale/* | grep -v C.UTF )
# sudo sed -i.orig-fehlix -e  "/^#/b;/^$/b; /^${LANG%.*}/b; /^en_US/b; s/^/# /; "  /etc/locale.gen
# sudo locale-gen
:cat:

Post Reply

Return to “MX Help”