24

After I've installed some language packs and spell checking dictionaries (I'd like to use with Firefox and OpenOffice) I've got tons of language variations installed. This makes very inconvenient to maintain dictionary additions, for example. Sometimes Firefox decides to switch to Australian, sometimes to UK dictionary, sometimes to US, etc.

For me, a Russian, English is just English, and German is just German. I think every English-speaking will understand me, may I write "color" or "colour", "dialog", or "dialogue" (I usually prefer classic UK spelling though, as a matter of a habit (as I was taught at school)). How to remove all those dialects?

6 Answers 6

8

Emi Bcn from Launchpad said:

Look at /usr/share/hunspell/ and delete all files you don't need/want. It's all!!

It worked for me except just in case I went to myspell and aspell folders too and erased the ones I didn't need.

2
  • Warning: It seems you must keep the current locale. I tried this and now echo | hunspell returns exit code 1 and prints the following error: "Can't open affix or dictionary files for dictionary named "en_AU"".
    – l0b0
    Apr 12, 2015 at 15:18
  • Don't delete files that were installed by packages, just remove the packages themselves. (The files would re-appear on every package upgrade anyway.)
    – JanC
    Apr 25, 2016 at 23:39
8

Though @chuo is correct that you can just delete the files in /usr/share/hunspell/ for locales that you don't want, much better is to uninstall the packages that deliver those files. To see the locale packages (myspell and hunspell) that you have installed, run

dpkg --get-selections | grep -v deinstall | egrep "^myspell-|^hunspell-"

then for each locale you'd like to remove uninstall the package with a command like this

sudo apt-get remove myspell-en-au

For my Ubuntu 14.04 installation I had myspell-en-au, myspell-en-za and myspell-en-gb which I uninstalled with the command

sudo apt-get remove myspell-en-.*
4

The problem is known, take look at bug 28226 and its duplicates. Feel free to vote for the bug using the "This bug affects me too" feature.

To summarize, English in Ubuntu means all variants (en-au, en-za, etc.), not just one. You could delete the individual spelling packages, myspell-en-* and hunspell-en-*, but that would also remove language-support-en, and I don't think that's what you want.

1
  • I think you mean language-pack-en, but that will not be removed.
    – JanC
    Apr 25, 2016 at 23:38
1

sudo apt-get install bleachbit

Then open bleachbit as a root, the first time it prompts you for the locales you want to left behind.. then, mark the corresponding checkbox under "system".

Click on "preview", then on "delete"

and that's it :)

1
  • 1
    Do not use bleachbit! A mistake can result in data loss, unwanted changes in configuration or a misbehaving desktop.
    – user77111
    Aug 30, 2012 at 8:47
1

To backup all non-US English dictionaries (remove --no-act after verifying what it'll do):

sudo rename --no-act 's/$/.bak/' /usr/share/hunspell/en_!(US).{aff,dic} 

Then restart your browser and only US English shows up.

In the case of languages which are redundant since the files are symlinks to the canonical language files (like fr_BE):

sudo find /usr/share/hunspell/ -type l \( -name '*.aff' -o -name '*.dic' \) -exec mv {} {}.bak \;
0

As far as modern versions of Ubuntu go—which use LibreOffice instead of OpenOffice—start by clearing out unused language packs. Find them with:

apt list --installed | grep firefox-locale
apt list --installed | grep libreoffice-help
apt list --installed | grep libreoffice-l10n

Then execute the sudo apt remove command followed by a space‐separated list of the packages one wants to remove. After restarting Firefox, the list of spellchecking dictionaries will be reduced if those packages had dictionaries associated with them. (There’s no dictionary to remove for Chinese, for example.)

This still leaves to be addressed dictionaries associated with unused national locales. For Firefox, this can be addressed by creating a new dictionary directory containing symbolic links to only the dictionaries that one wants to use and linking this directory to Firefox using the spellchecker.dictionary_path preference.

Example:

mkdir ~/hunspell/
ln --symbolic /usr/share/hunspell/en_US.aff /usr/share/hunspell/en_US.dic /usr/share/hunspell/es_US.aff /usr/share/hunspell/es_US.dic ~/hunspell/

After executing the above commands, open the about:config page in Firefox, and change the value of the spellchecker.dictionary_path preference so that it references the directory containing the symbolic links. In the preceding example, one would use the path value ~/hunspell. After restarting Firefox, there should only be two dictionaries offered for spellchecking: English (United States) and Spanish (United States).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .