How to fix dpkg: error: --add-architecture needs exactly one argument in APT

APTBEGINNERLOWUpdated Dec 29, 2025ยท 171 views

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.

Quick fix

Fixes dpkg: error: --add-architecture needs exactly one argument

# 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 argument
  1. Check the current syntax you are using
  2. Use the correct dpkg --add-architecture syntax
  3. If adding multiple architectures, run separate commands
  4. Update package lists after adding the architecture
apt โ€” error
# 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 argument
dpkg: error: --add-architecture needs exactly one argument

What this error means

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.

Typical symptoms

  • Command fails when running dpkg --add-architecture with additional flags
  • Error message explicitly states "needs exactly one argument"
  • Unable to enable multiarch support on the system
  • apt-get update or apt-get install fails when trying to use foreign architecture packages
  • Wrapper scripts or automation tools fail when setting up multiarch

Common causes

  1. Passing multiple architecture names: dpkg --add-architecture i386 arm64 (should be separate commands)
  2. Including additional dpkg options with --add-architecture: dpkg --add-architecture i386 --root /
  3. Using --add-architecture with unsupported flags like --force or --no-warn
  4. Spacing or quoting issues causing the argument to be split incorrectly
  5. Calling dpkg --add-architecture from an automated script that appends extra parameters

How to fix "dpkg: error: --add-architecture needs exactly one argument"

1Check the current syntax you are using

First, review the exact command you ran that produced the error. Look for any extra flags or arguments after the architecture name.

bash
# 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 argument
2Use the correct dpkg --add-architecture syntax

The --add-architecture command takes exactly one argument: the architecture name. Remove any additional flags or arguments.

bash
# Correct syntax:
sudo dpkg --add-architecture i386
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhf

Common 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)

3If adding multiple architectures, run separate commands

If you need to enable support for multiple foreign architectures, run dpkg --add-architecture once for each architecture:

bash
sudo dpkg --add-architecture i386
sudo dpkg --add-architecture arm64
sudo apt-get update

Do not attempt to pass multiple architectures in one command.

4Update package lists after adding the architecture

After successfully adding the architecture, update your package lists so apt is aware of packages available for the new architecture:

bash
sudo apt-get update

You can now install packages for that architecture using the syntax package:architecture. For example:

bash
sudo apt-get install libc6:i386       # Install 32-bit libc6
sudo apt-get install wine:i386        # Install 32-bit Wine
5Verify the architecture was added successfully

Confirm that the architecture is now registered on your system:

bash
# View your system's native architecture:
dpkg --print-architecture

# View all foreign architectures you've added:
dpkg --print-foreign-architectures

The architecture you added should appear in the output of the second command.

Advanced notes

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:

bash
sudo sh -c "echo 'foreign-architecture i386' > /etc/dpkg/dpkg.cfg.d/multiarch"
sudo apt-get update

This 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".

Frequently asked questions

What does "dpkg: error: --add-architecture needs exactly one argument" mean?
, 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.
How do I fix "dpkg: error: --add-architecture needs exactly one argument"?
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.
What causes "dpkg: error: --add-architecture needs exactly one argument"?
Passing multiple architecture names: dpkg --add-architecture i386 arm64 (should be separate commands) Including additional dpkg options with --add-architecture: dpkg --add-architecture i386 --root / Using --add-architecture with unsupported flags like --force or --no-warn
Is the "dpkg: error: --add-architecture needs exactly one argument" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading