How to fix dpkg: error: cannot remove architecture 'i386' currently in use by the database in APT
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'- List all i386 packages currently installed
- Remove all i386 packages using apt
- Verify packages are removed
- Remove the i386 architecture from dpkg
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
- 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
How to fix "dpkg: error: cannot remove architecture 'i386' currently in use by the database"
First, check which i386 packages you have:
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).
Use apt-get to cleanly purge all i386 packages from the system:
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.
Confirm that no i386 packages remain:
dpkg -l | grep ':i386'This command should now return no output, meaning all i386 packages have been successfully removed.
Now that all i386 packages are gone, you can safely remove the architecture:
sudo dpkg --remove-architecture i386This command should complete without error.
Confirm that i386 is no longer registered in dpkg:
dpkg --print-foreign-architecturesThis 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:
dpkg --print-architectureThis 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:
deb [arch=amd64] http://deb.debian.org/debian bookworm main contrib non-freeThis 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
- ๐APT Official Documentation
- ๐
- ๐Debian Bug Report #676420: Cannot remove architecture(Official Docs)