How to Handle “dpkg-reconfigure: command not found” in Debian 10 and Alternative Solutions for Locales Configuration


3 views

If you've recently upgraded to Debian 10 (Buster) and found yourself staring at a command not found error when trying to run dpkg-reconfigure, you're not alone. The command was moved to a separate package called debconf which isn't installed by default in the new release.

Debian's packaging system has been undergoing optimizations to reduce the base system footprint. Some utilities that were previously included in essential packages have been moved to optional packages. The dpkg-reconfigure tool is now part of the debconf package, along with several other configuration utilities.

To get dpkg-reconfigure back, simply install the debconf package:

sudo apt update
sudo apt install debconf

If you specifically need to configure locales without using dpkg-reconfigure, here are two alternative methods:

Method 1: Using update-locale

For basic locale settings:

sudo update-locale LANG=en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8

Method 2: Manual Configuration

Edit the locale configuration file directly:

sudo nano /etc/locale.gen
# Uncomment the locales you need (e.g., en_US.UTF-8 UTF-8)
# Then generate them:
sudo locale-gen

The separation of dpkg-reconfigure into its own package makes sense from a modularity perspective. Administrators who need these tools can install them, while minimal systems can omit them. However, the change wasn't sufficiently highlighted in the upgrade process, causing confusion.

1. Always check package dependencies after major upgrades
2. Consider adding debconf to your standard server setup if you frequently reconfigure packages
3. For scripted environments, explicitly declare all dependencies including debconf

If you have automation scripts that rely on dpkg-reconfigure, you'll need to either:
- Add debconf as a prerequisite in your provisioning scripts
- Rewrite the relevant portions to use alternative configuration methods

For example, instead of:

dpkg-reconfigure -f noninteractive tzdata

You could use:

echo "America/New_York" > /etc/timezone
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime

While the change might seem inconvenient at first, it follows the Unix philosophy of modularity. By understanding these changes and adapting our workflows, we can maintain efficient system administration while benefiting from a leaner base system.


If you're running Debian 10 (Buster) and suddenly find that dpkg-reconfigure is unavailable, you're not alone. This utility, along with poweroff and reboot, was moved to the debconf package which isn't installed by default in newer Debian versions.

The simplest solution is to install the package containing these utilities:

sudo apt update
sudo apt install debconf

If you specifically need to reconfigure locales without dpkg-reconfigure, here are two approaches:

Method 1: Using locale-gen

Edit the locale configuration file:

sudo nano /etc/locale.gen

Uncomment your desired locales, then run:

sudo locale-gen

Method 2: Using update-locale

To set the system-wide default locale:

sudo update-locale LANG=en_US.UTF-8

Debian has been moving toward a more minimal base installation. The debconf package, while useful, isn't considered essential for all systems. This change reflects the distribution's focus on modularity and reducing default dependencies.

If you frequently need these commands, consider adding aliases to your .bashrc:

echo "alias poweroff='/sbin/systemctl poweroff'" >> ~/.bashrc
echo "alias reboot='/sbin/systemctl reboot'" >> ~/.bashrc
source ~/.bashrc

After configuration, verify your locales with:

locale -a

Some packages still require dpkg-reconfigure for proper configuration. In these cases, installing debconf is the right approach. For example, reconfiguring tzdata:

sudo apt install debconf
sudo dpkg-reconfigure tzdata