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

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

Safely Remove a Wordlist with remove-default-wordlist

remove-default-wordlist pulls a removed package's entries from the dictionaries-common database, and can trigger selection of a new default. 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 just 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, because the helper changes shared dictionary-selection state and can trigger 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 one 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 let the package's maintainer scripts call the helper at the right point in the lifecycle. That 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 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, so a return to the shell is not enough evidence by itself. 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 investigating before you retry or remove another package. Do not substitute a dictionary filename, a locale such as en_GB, or a package 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, and that is normal. The helper still removes the package's entries from the dictionaries-common database and 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 just because the selection is not made immediately. Let the package manager finish, then check 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

  • Wrong argument type. Do not pass a language name where a Debian package name is required.
  • Testing on a live system. Do not run the helper just to see what it prints; its documented purpose is package removal.
  • Misreading silence. No prompt does not mean the operation failed. A non-default package can be removed without selecting anything.
  • Hand-editing the cache. Do not delete files under /var/cache/dictionaries-common as a substitute for updating the database.
  • Interrupting mid-transaction. Do not stop an upgrade while a replacement wordlist is still being unpacked.

Done means

  • Argument exact: the argument was the exact wordlist package being removed.
  • Transaction clean: the package transaction completed without an unresolved dpkg audit error.
  • Replacement chosen: a replacement was selected when the removed package had been the default.
  • Package intact: dictionaries-common remains installed and configured.
  • Recovery understood: you can explain how to reinstall the removed package if the change was accidental.