How to fix dpkg: error: cannot remove architecture 'i386' currently in use by the database in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025ยท 273 views

This error occurs when trying to remove a foreign architecture (like i386) from dpkg while packages from that architecture are still installed. You must uninstall all packages from the target architecture before removing it.

Quick fix

Fixes dpkg: error: cannot remove architecture 'i386' currently in use by the database

dpkg -l | grep ':i386'
  1. List all i386 packages currently installed
  2. Remove all i386 packages using apt
  3. Verify packages are removed
  4. Remove the i386 architecture from dpkg
apt โ€” error
dpkg -l | grep ':i386'
dpkg: error: cannot remove architecture 'i386' currently in use by the database

What this error means

When you run `dpkg --remove-architecture i386`, dpkg checks if any packages from that architecture are still installed in the system. If packages exist, dpkg refuses to remove the architecture to prevent breaking the system. This is a safety mechanism because some applications may depend on 32-bit libraries even on 64-bit systems. The error specifically means the dpkg database still contains references to packages or dependencies from the i386 architecture. Until all those packages are purged, the architecture record cannot be removed.

Typical symptoms

  • Command `sudo dpkg --remove-architecture i386` fails with 'currently in use by the database' error
  • Cannot switch from multiarch (supporting multiple architectures) to single architecture
  • System reports i386 as an active foreign architecture when you check with `dpkg --print-foreign-architectures`

Common causes

  1. One or more i386 packages are still installed on the system
  2. Package dependencies or virtual packages still reference the i386 architecture
  3. The dpkg database wasn't properly cleaned after manual package removal attempts

How to fix "dpkg: error: cannot remove architecture 'i386' currently in use by the database"

1List all i386 packages currently installed

First, check which i386 packages you have:

bash
dpkg -l | grep ':i386'

This shows a list of all packages with the :i386 suffix. Note which ones are installed (marked with 'ii' in the first column).

2Remove all i386 packages using apt

Use apt-get to cleanly purge all i386 packages from the system:

bash
sudo apt-get purge '.*:i386'

The purge command removes both the package and its configuration files, ensuring a clean removal. The wildcard pattern matches any package ending in :i386.

If apt asks for confirmation, type 'y' and press Enter. This step removes all multiarch packages at once.

3Verify packages are removed

Confirm that no i386 packages remain:

bash
dpkg -l | grep ':i386'

This command should now return no output, meaning all i386 packages have been successfully removed.

4Remove the i386 architecture from dpkg

Now that all i386 packages are gone, you can safely remove the architecture:

bash
sudo dpkg --remove-architecture i386

This command should complete without error.

5Verify the architecture was removed

Confirm that i386 is no longer registered in dpkg:

bash
dpkg --print-foreign-architectures

This should return nothing or show only other architectures if you have multiple. The i386 architecture should no longer appear.

Optionally, verify your primary architecture is unchanged:

bash
dpkg --print-architecture

This should still show your primary architecture (usually amd64 or arm64).

Advanced notes

If you're switching away from multiarch completely, you can also optionally update your /etc/apt/sources.list and sources.d files to specify architecture explicitly:

bash
deb [arch=amd64] http://deb.debian.org/debian bookworm main contrib non-free

This prevents apt from trying to fetch packages for architectures you no longer support. However, this is optional and not required to remove the architecture.

On systems with SELinux enabled (some distributions), you may encounter additional permission issues. If so, check that your user has proper sudo access and that the dpkg database in /var/lib/dpkg has correct permissions.

Frequently asked questions

What does "dpkg: error: cannot remove architecture 'i386' currently in use by the" mean?
When you run dpkg --remove-architecture i386, dpkg checks if any packages from that architecture are still installed in the system. If packages exist, dpkg refuses to remove the architecture to prevent breaking the system. This is a safety mechanism because some applications may depend on 32-bit libraries even on 64-bit systems.
How do I fix "dpkg: error: cannot remove architecture 'i386' currently in use by the"?
This error occurs when trying to remove a foreign architecture (like i386) from dpkg while packages from that architecture are still installed. You must uninstall all packages from the target architecture before removing it.
What causes "dpkg: error: cannot remove architecture 'i386' currently in use by the"?
One or more i386 packages are still installed on the system Package dependencies or virtual packages still reference the i386 architecture The dpkg database wasn't properly cleaned after manual package removal attempts
Is the "dpkg: error: cannot remove architecture 'i386' currently in use by the" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading