The dpkg --add-architecture command failed because extra arguments were passed. This error occurs when trying to add a foreign architecture to your system for multiarch support, but additional unexpected options like --root are included. Fix it by passing only the architecture name as a single argument.
The dpkg --add-architecture command is used to enable multiarch support on Debian and Ubuntu systems, allowing you to install packages from different architectures (e.g., 32-bit packages on a 64-bit system). This command is very strict about its arguments and accepts exactly one parameter: the architecture name (like i386, arm64, or armhf). When dpkg detects that you've passed more than one argument or unexpected options to --add-architecture, it rejects the command and displays this error. This is a safety mechanism to prevent misconfiguration of your system's multiarch settings.
First, review the exact command you ran that produced the error. Look for any extra flags or arguments after the architecture name.
# Examples of INCORRECT syntax that cause this error:
dpkg --add-architecture i386 --root / # Extra flag
dpkg --add-architecture i386 arm64 # Multiple architectures
dpkg --add-architecture "i386" extra # Extra argumentThe --add-architecture command takes exactly one argument: the architecture name. Remove any additional flags or arguments.
# Correct syntax:
sudo dpkg --add-architecture i386
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhfCommon valid architecture names:
- i386 - 32-bit x86
- amd64 - 64-bit x86 (usually the default)
- arm64 - 64-bit ARM
- armhf - 32-bit ARM with hardware floating point
- armel - 32-bit ARM with soft floating point
- ppc64el - 64-bit PowerPC (little-endian)
If you need to enable support for multiple foreign architectures, run dpkg --add-architecture once for each architecture:
sudo dpkg --add-architecture i386
sudo dpkg --add-architecture arm64
sudo apt-get updateDo not attempt to pass multiple architectures in one command.
After successfully adding the architecture, update your package lists so apt is aware of packages available for the new architecture:
sudo apt-get updateYou can now install packages for that architecture using the syntax package:architecture. For example:
sudo apt-get install libc6:i386 # Install 32-bit libc6
sudo apt-get install wine:i386 # Install 32-bit WineConfirm that the architecture is now registered on your system:
# View your system's native architecture:
dpkg --print-architecture
# View all foreign architectures you've added:
dpkg --print-foreign-architecturesThe architecture you added should appear in the output of the second command.
If your version of dpkg does not support the --add-architecture option (found on very old Ubuntu versions prior to 12.04 LTS or Debian versions before the multiarch implementation), you can manually configure multiarch by creating a configuration file:
sudo sh -c "echo 'foreign-architecture i386' > /etc/dpkg/dpkg.cfg.d/multiarch"
sudo apt-get updateThis manual approach bypasses the dpkg command and directly configures the system.
To remove a foreign architecture later if you no longer need it, use: sudo dpkg --remove-architecture i386 (replacing i386 with your architecture). Note that all packages of that architecture must be removed first, or dpkg will report "currently in use by the database".
E: Cannot set to hold: package 'package-name' is not installed
How to fix "Cannot set to hold" error when package is not installed in APT
debconf: unable to initialize frontend: Dialog
How to fix "debconf: unable to initialize frontend: Dialog" in APT
E: Could not connect to proxy server
Could not connect to proxy server
dpkg: serious warning: files list file for package 'package-name' contains empty filename
How to fix "files list file contains empty filename" in APT
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt