How to fix dpkg: warning: cannot remove non-foreign architecture 'amd64' in APT

APTBEGINNERLOWUpdated Dec 29, 2025ยท 178 views

This warning appears when attempting to remove your system's native architecture with dpkg. You can only remove foreign (additional) architectures that were added via dpkg --add-architecture, not the primary system architecture.

Quick fix

Fixes dpkg: warning: cannot remove non-foreign architecture 'amd64'

dpkg --print-architecture
  1. Check your system's native architecture
  2. List foreign architectures currently added
  3. Understand the difference
  4. If you need to remove a foreign architecture
apt โ€” error
dpkg --print-architecture
dpkg: warning: cannot remove non-foreign architecture 'amd64'

What this error means

Every Linux system has one native architecture (the CPU architecture it runs on, like amd64 for 64-bit systems). dpkg distinguishes between this native architecture and "foreign" architectures that have been explicitly added to support multiarch (running 32-bit and 64-bit binaries together). The warning "cannot remove non-foreign architecture" indicates you're trying to remove your system's native architecture, which is not allowed. Foreign architectures (like i386 on an amd64 system) can be added and removed, but the native architecture is permanent and essential for your system to function.

Typical symptoms

  • Attempting to remove architecture amd64 fails with the dpkg warning
  • dpkg --remove-architecture amd64 reports the architecture cannot be removed
  • System architecture listed by dpkg --print-architecture cannot be removed

Common causes

  1. Attempting to remove your system's native/primary architecture (not allowed by design)
  2. Mistaking the native architecture for a foreign/additional architecture that can be removed
  3. Misunderstanding the difference between native and foreign architectures in dpkg multiarch

How to fix "dpkg: warning: cannot remove non-foreign architecture 'amd64'"

1Check your system's native architecture

Run dpkg --print-architecture to see your system's native architecture. This is the one you cannot remove.

bash
dpkg --print-architecture

On most modern 64-bit systems, this will output amd64. This is your native architecture and cannot be removed.

2List foreign architectures currently added

If you want to remove an architecture, first check which foreign architectures have been added to your system:

bash
dpkg --print-foreign-architectures

If the output is empty, no foreign architectures have been added. Only architectures listed here can be removed.

3Understand the difference

In a multiarch setup:
- Native architecture: The CPU architecture of your hardware (e.g., amd64). Listed by dpkg --print-architecture. This cannot be removed.
- Foreign architectures: Additional architectures added to support multiarch (e.g., i386 on amd64). Listed by dpkg --print-foreign-architectures. These can be added and removed.

Common foreign architectures include i386 (32-bit) on amd64 (64-bit) systems, or arm64 on amd64 systems.

4If you need to remove a foreign architecture

To remove a foreign architecture (not your native one), use:

bash
sudo dpkg --remove-architecture i386

Before doing this, ensure no packages of that architecture are installed. You may need to uninstall them first:

bash
sudo apt-get purge ".*:i386"
sudo dpkg --remove-architecture i386

Note: Replace i386 with the actual foreign architecture you want to remove.

Advanced notes

The native architecture is hardcoded into dpkg's database and cannot be changed without reinstalling the system. Attempting to remove it is a protection mechanism to prevent system damage. If you genuinely need to change your system's primary architecture, you would need to perform a full OS reinstall targeting the desired architecture. Multiarch is primarily designed for 32-bit compatibility (i386) on 64-bit (amd64) systems, or for cross-architecture development.

Frequently asked questions

What does "dpkg: warning: cannot remove non-foreign architecture 'amd64'" mean?
Every Linux system has one native architecture (the CPU architecture it runs on, like amd64 for 64-bit systems). dpkg distinguishes between this native architecture and "foreign" architectures that have been explicitly added to support multiarch (running 32-bit and 64-bit binaries together). The warning "cannot remove non-foreign architecture" indicates you're trying to remove your system's native architecture, which is not allowed.
How do I fix "dpkg: warning: cannot remove non-foreign architecture 'amd64'"?
This warning appears when attempting to remove your system's native architecture with dpkg. You can only remove foreign (additional) architectures that were added via dpkg --add-architecture, not the primary system architecture.
What causes "dpkg: warning: cannot remove non-foreign architecture 'amd64'"?
Attempting to remove your system's native/primary architecture (not allowed by design) Mistaking the native architecture for a foreign/additional architecture that can be removed Misunderstanding the difference between native and foreign architectures in dpkg multiarch
Is the "dpkg: warning: cannot remove non-foreign architecture 'amd64'" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading