Set and Verify Debian's Default Word List
Spell checkers and utilities that read /usr/share/dict/words only ever see one word list at a time, and select-default-wordlist is what decides which. This walks through checking which files the shared links actually reach, so you do not silently select the wrong language. Allow about ten minutes. You need dictionaries-common and at least one word-list package installed; changing the default rewrites system links, so use an account with sudo access and check the result before relying on it.
The route
Jump straight to the step you need, or tick off Done means at the end.
1. Check the installed tool and word lists
This guide follows dictionaries-common 1.29.7, the version installed here. The command's interface is long options only. The American list comes from wamerican 2020.12.07-2 and is stored at /usr/share/dict/american-english.
$ command -v select-default-wordlist
/usr/sbin/select-default-wordlist
$ dpkg-query -W -f='${Package} ${Version}\n' dictionaries-common wamerican
dictionaries-common 1.29.7
wamerican 2020.12.07-2
List the choices before selecting one. This is read-only, but the program deliberately writes choices to standard error because debconf captures standard output:
$ sudo select-default-wordlist --show-choices 2>&1
american (American English)
Your list will be longer if other word-list packages are installed. Treat the displayed text as the matchable choice, not as a filename you should invent. An empty or unexpectedly short list usually means the required word-list package is missing or its dictionaries-common registration needs attention.
2. Inspect the current default
The configuration runs through two links. /etc/dictionaries-common/words points at the selected file, and /usr/share/dict/words points at that link, for programs that use the conventional path. Inspect both without changing anything:
$ ls -l /etc/dictionaries-common/words /usr/share/dict/words
lrwxrwxrwx 1 root root ... /etc/dictionaries-common/words -> /usr/share/dict/american-english
lrwxrwxrwx 1 root root ... /usr/share/dict/words -> /etc/dictionaries-common/words
$ readlink -f /usr/share/dict/words
/usr/share/dict/american-english
The file named by readlink -f is the effective list. Do not judge the setting from the link text alone: the intermediate link matters.
Checkpoint
If the resolved path is already the list you want, stop here. There is no benefit in running a setter merely to repeat the current choice.
3. Select one unambiguous choice
Pass a regular expression to --set-default. The program first tries a case-dependent match, then a case-independent match, and it must find exactly one choice, otherwise it fails rather than guessing. For the choice shown above:
$ sudo select-default-wordlist --set-default='^american \(American English\)$'
$ readlink -f /etc/dictionaries-common/words
/usr/share/dict/american-english
The parentheses in the expression are escaped because they are regular-expression grouping characters, and the quotes protect it from shell expansion. If your --show-choices output differs, copy one complete displayed choice and build a suitable expression for that exact text. Keep it narrow: a broad expression such as english can match more than one installed list, and is expected to fail when it is not unique.
This step needs elevated privileges because it updates the system's default selection and invokes update-default-wordlist internally. It does not convert or edit the contents of a word list, only which installed list the shared links point at.
4. Verify the file and its contents
The american-english(5) file is an ASCII, alphabetic list with one word per line. Check the target, encoding hint and a few lines:
$ target=$(readlink -f /usr/share/dict/words)
$ printf 'target: %s\n' "$target"
target: /usr/share/dict/american-english
$ file "$target"
/usr/share/dict/american-english: ASCII text
$ head -5 "$target"
A
AA
AAA
AA's
AB
The exact file wording can vary. The useful checks are that the target exists, is readable, and holds one entry per line. A word list is data for software such as spell checkers; it is not a complete language dictionary, and its contents can come from different sources.
5. Handle failures without guessing
If the command says there is no unique match, do not widen the expression blindly. Run --show-choices again, then use a complete distinctive choice: this is a safe failure, since no default is selected when matching does not succeed.
$ sudo select-default-wordlist --set-default='definitely-no-wordlist-match'
select-default-wordlist: No (unique) match for "definitely-no-wordlist-match". Aborting ...
- "Must run as root": put
sudobefore the command, and do not run it through a shell that strips or rewrites the quoted expression. sudounavailable: ask an administrator to run the exact setter after you have identified the intended choice.- Wrong choice made accidentally: rerun
--show-choices, select the intended single choice, and verify the resolved link again. There is no separate undo command, because the normal recovery is another deliberate selection.
Do not remove the links manually: package maintenance and dictionaries-common expect this managed layout.
Done means
- Choices listed.
select-default-wordlist --show-choicesdisplayed the available choices on standard error. - Match was exact. The chosen regular expression matched exactly one displayed choice.
- Setter completed. It ran with
sudo, when required, and did not need a guessed filename. - Link resolved correctly.
readlink -f /usr/share/dict/wordsresolves to the intended installed list. - Contents checked. The resolved file is readable and has the expected one-entry-per-line format.