[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?



On Tue 15 Nov 2022 at 16:37:58 (-0800), David Christensen wrote:
> On 11/15/22 00:22, DdB wrote:
> > Am 15.11.2022 um 05:21 schrieb David Christensen:
> > > I installed the localepurge package.  Storage usage did not change. Then
> > > I realized that I had chosen the "C" locale during installation, so
> > > perhaps there is nothing to be removed (?).  So, I removed the
> > > localepurge package.
> 
> > I just read (from /usr/share/doc/localepurge/README.dpkg-path):
> > > localepurge dpkg support
> > > ------------------------
> > > 
> > > Starting with version 1.15.8, dpkg supports --path-include and
> > (...)
> > > 
> > >   * It cannot be used to purge locale files from already installed
> > >     packages.
> > >     - Though it will be fixed on next upgrade (or reinstall) of the
> > >       packages.
> > (...)
> > 
> > which indicates, that your observations had to be expected, if you opted
> > for dpkg-path :-)
> 
> Well, that explains it.  Thanks for pointing that out.
> 
> Is it possible to not install locale files in the first place?  E.g.
> when running d-i, and whenever using the package system thereafter?

https://lists.debian.org/debian-user/2020/10/msg00308.html

recommends that you stick to eliminating files listed in
/var/lib/dpkg/info/*.md5sums because they're easy to restore,
and their contents shouldn't ever have been changed (or they
wouldn't be listed here).

So it should be easy to devise grep patterns that hit the files that
you don't want, while preserving those you do, like say:

$ grep -v 'en_GB/LC_MESSAGES' /var/lib/dpkg/info/*.md5sums | grep  'LC_MESSAGES.*\.mo$' | less

or, if you're from Cornwall:

$ grep -v '_GB/LC_MESSAGES' /var/lib/dpkg/info/*.md5sums | grep  'LC_MESSAGES.*\.mo$' | less

The OP removed 1½GB, which is far more than I matched, but I didn't
run or trace the OP's script to investigate the quantity and contents.
Perhaps my not running a DE has something to do with the quantity.

Cheers,
David.

Reply to: