Home / Alt manpages / select-default-wordlist(8)

  • select-default-wordlist(8)
  • Admin command
  • linux

Set and Verify Debian's Default Word List

You will choose a system word list with select-default-wordlist, check which files the shared links reach, and avoid silently selecting the wrong language. Allow about ten minutes. You need dictionaries-common and at least one word-list package installed. Choosing a default changes system links, so use an account with sudo access and check the result before relying on it.

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 file name 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 is exposed 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. 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. The quotes protect the expression 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. The command does not convert or edit the contents of a word list. It changes which installed list the shared links refer to.

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 contains 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: 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 ...

If it says that you must run as root, put sudo before the command. Do not run the command through a shell that strips or rewrites the quoted expression. If sudo is unavailable, ask an administrator to run the exact setter after you have identified the intended choice.

If a selection was 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

  • select-default-wordlist --show-choices displayed the available choices on standard error.
  • The chosen regular expression matched exactly one displayed choice.
  • The setter completed with sudo, when required, and did not need a guessed file name.
  • readlink -f /usr/share/dict/words resolves to the intended installed list.
  • The resolved file is readable and has the expected one-entry-per-line format.