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

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

Safely Remove a Wordlist from dictionaries-common

remove-default-wordlist removes a wordlist package from the dictionaries-common database and, when necessary, starts selection of a replacement. The safe result is a consistent dictionary configuration after a package removal, not merely a missing file.

This guide applies to the installed dictionaries-common 1.29.7 package. Allow about five minutes for a normal package-maintenance task. You need the exact package name and root privileges. If you are only trying to remove a wordlist as an ordinary administrator, let the package manager run its maintainer scripts instead of calling this helper directly.

Checkpoint: understand the boundary

The program is a package-removal helper. Its documented interface is deliberately small:

remove-default-wordlist <package>

The argument is the package name being removed, not a language code, dictionary filename, or path. The manual page warns against command-line use unless you know exactly what you are doing. That warning matters because the helper changes shared dictionary-selection state and can invoke a new selection when the removed package supplied the current default.

First confirm which package provides the wordlist and whether it is actually installed. Replace the example package with the package you intend to remove:

wordlist_package='<wordlist-package-name>'
dpkg-query -W -f='${Package} ${Version} ${Status}\n' "$wordlist_package"

Expected output contains the package name, its version and install ok installed. If the package is not installed, stop. Passing a guessed or already-removed package name is not a useful repair.

1. Let the package manager own ordinary removals

For a normal removal, use apt or dpkg and allow the package's maintainer scripts to call the helper at the correct point in the lifecycle. This preserves the ordering between the package being removed, the dictionaries-common database and any replacement package being installed.

sudo apt remove <wordlist-package-name>

This is the preferred operational path. Read the transaction before accepting it, especially on a host where spelling support is used by editors, mail software or document tools. Removing a wordlist can affect more than the command currently in front of you.

Warning

Package removal changes system state. Do not use the command above merely to test the helper. If you need to keep the package, leave it installed and stop at this checkpoint.

2. Call the helper only for a controlled maintainer-script repair

Manual invocation is for a specific recovery or packaging task where you have already established that the named wordlist package is being removed and that the normal package transaction will not perform this step. Run it as root, with the package name quoted exactly as reported by dpkg-query:

sudo /usr/sbin/remove-default-wordlist "$wordlist_package"

The command does not promise a human-readable success message. A return to the shell is not enough evidence by itself, so capture the status immediately:

status=$?
printf 'remove-default-wordlist exit status: %s\n' "$status"
test "$status" -eq 0

A zero status lets the surrounding operation continue. A non-zero status needs investigation before you retry or remove another package. Do not substitute a dictionary filename, a locale such as en_GB, or a package that is merely related to the wordlist.

3. Handle replacement selection at the prompt

If the removed package supplied the current default and other wordlists remain registered, the helper asks dictionaries-common to select a new one. Choose a replacement that is installed and appropriate for the software using the dictionary. This is a configuration decision, not a download step: the helper does not turn an arbitrary filename into a valid wordlist.

If the package was not the current default, there may be no selection prompt. That is normal. The helper still removes the package's entries from the dictionaries-common database and then updates the default-wordlist state.

When another wordlist is being installed in the same package transaction, the update can be deferred until that package has been unpacked. Do not interrupt the transaction simply because the selection is not made immediately. Let the package manager finish, then check the package state:

dpkg --audit
dpkg-query -W -f='${Package} ${Status}\n' dictionaries-common

dpkg --audit should print nothing for a clean package database. The second command should report dictionaries-common install ok installed. These checks confirm package consistency; they do not claim that a particular language is your preferred selection.

4. Recover without repeating the removal blindly

If the command failed or a prompt was answered incorrectly, record the exact package transaction and inspect the package manager's error before trying again. Repeating the helper with a different guessed argument can remove the wrong database entry.

For an interrupted package removal, finish the package manager's pending configuration first:

sudo dpkg --configure -a

If you removed the wrong wordlist and it is still available from your configured repositories, reinstall that package through the package manager, then select it again using the normal dictionaries-common configuration path. The helper itself is not an undo command and does not restore a removed package.

5. Avoid the common traps

  • Do not pass a language name where a Debian package name is required.
  • Do not run the helper on a live system just to see what it prints. Its documented purpose is package removal.
  • Do not assume that no prompt means the operation failed. A non-default package can be removed without selecting anything.
  • Do not delete files under /var/cache/dictionaries-common as a substitute for updating the database.
  • Do not interrupt an upgrade while a replacement wordlist is still being unpacked.

Done means

  • The argument was the exact wordlist package being removed.
  • The package transaction completed without an unresolved dpkg audit error.
  • A replacement was selected when the removed package had been the default.
  • dictionaries-common remains installed and configured.
  • You can explain how to reinstall the removed package if the change was accidental.