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.
Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
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? Davud
Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
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. > > > David 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 :-)
Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
On 11/13/22 23:15, DdB wrote: Am 14.11.2022 um 07:16 schrieb Anssi Saari: Charles Curley writes: On Sun, 13 Nov 2022 16:32:51 +0100 DdB wrote: every backup contains loads of unnecessary language files, and i saw them scroll by during rsync. So one day, i wanted to get rid of those. You might take a look at the localepurge package. As I'm a little short on space on /, it's interesting but the description says: "This tool is a hack which is *not* integrated with the system's package management system and therefore is not for the faint of heart. Its interference can provoke strange, but usually harmless, behavior in programs related to apt/dpkg, such as dpkg-repack, reportbug, etc. Responsibility for its usage and possible breakage of the system therefore lies in the system administrator's hands. " So while I'm not faint of heart, I think I'll rather resize my / partition. Even if it means moving partitions around a little. Thank you for pointing at that. I looked at that package in a VM and found: although its language discovery is better than mine, it is failing to find some language files, that i my script would. And besides: my vm's do not have an actual problem with space. It is more the backups (and their snapshots) containing multiple versions thereof that are troubling me. I think, i am going to look at their hack itself in an intent to learn from it, instead of using it. 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. David
Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
Am 14.11.2022 um 07:16 schrieb Anssi Saari: > Charles Curley writes: > >> On Sun, 13 Nov 2022 16:32:51 +0100 >> DdB wrote: >> >>> every backup contains loads of unnecessary language files, and i saw >>> them scroll by during rsync. So one day, i wanted to get rid of those. >> >> You might take a look at the localepurge package. > > As I'm a little short on space on /, it's interesting but the > description says: > > "This tool is a hack which is *not* integrated with the system's > package management system and therefore is not for the faint of heart. > Its interference can provoke strange, but usually harmless, behavior in > programs related to apt/dpkg, such as dpkg-repack, reportbug, etc. > Responsibility for its usage and possible breakage of the system > therefore lies in the system administrator's hands. > " > > So while I'm not faint of heart, I think I'll rather resize my / > partition. Even if it means moving partitions around a little. > > > Thank you for pointing at that. I looked at that package in a VM and found: although its language discovery is better than mine, it is failing to find some language files, that i my script would. And besides: my vm's do not have an actual problem with space. It is more the backups (and their snapshots) containing multiple versions thereof that are troubling me. I think, i am going to look at their hack itself in an intent to learn from it, instead of using it.
Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
Charles Curley writes: > On Sun, 13 Nov 2022 16:32:51 +0100 > DdB wrote: > >> every backup contains loads of unnecessary language files, and i saw >> them scroll by during rsync. So one day, i wanted to get rid of those. > > You might take a look at the localepurge package. As I'm a little short on space on /, it's interesting but the description says: "This tool is a hack which is *not* integrated with the system's package management system and therefore is not for the faint of heart. Its interference can provoke strange, but usually harmless, behavior in programs related to apt/dpkg, such as dpkg-repack, reportbug, etc. Responsibility for its usage and possible breakage of the system therefore lies in the system administrator's hands. " So while I'm not faint of heart, I think I'll rather resize my / partition. Even if it means moving partitions around a little.
Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
Hello, On Sun, Nov 13, 2022 at 04:32:51PM +0100, DdB wrote: > Would anyone be willing to take a look at what i have been doing and > guide me to a resolution of the missing parts? > > My current (bash) script can be found here: > https://paste.debian.net/1260563/ There is an existing package "localpurge" in Debian that does this. Here's more info: https://sleeplessbeastie.eu/2018/09/03/how-to-remove-useless-localizations/ I've only used it in one place but it worked fine. It also manages dpkg configuration to filter out the relevant file paths from future installation. Cheers, Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting
Re: RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
On Sun, 13 Nov 2022 16:32:51 +0100 DdB wrote: > every backup contains loads of unnecessary language files, and i saw > them scroll by during rsync. So one day, i wanted to get rid of those. You might take a look at the localepurge package. -- Does anybody read signatures any more? https://charlescurley.com https://charlescurley.com/blog/
RFC: What would be the "correct debian way" to clean up unwanted languages from an installation?
Hello, every backup contains loads of unnecessary language files, and i saw them scroll by during rsync. So one day, i wanted to get rid of those. What a surprise: doing it in my (rather simplistic) fashion, i got rid of almost 1,5 GB from every buster machine, i had ... only to find, that they were eventually coming back through system updates. :-( But - since my know-how on debian is very restrained - i did create a script, that allowed me to examine the situation more easily, without damaging the install, i was looking at. And only after verification did i run the removal. (BTW: in bullseye, i found there was much less unnecessary stuff) But still, the deleted files came back through updates, because i dont know, how to tell apt about my removals the proper way. Would anyone be willing to take a look at what i have been doing and guide me to a resolution of the missing parts? My current (bash) script can be found here: https://paste.debian.net/1260563/ Thank you for your attention DdB