Cannot install any package in Ubuntu using dpkg, getting "package architecture does not match system"

Whenever I want to upgrade or install any package on Ubuntu 16.04 this error appears!

dpkg: error processing /var/cache/apt/archives/gcc-6-base_6.0.1-ubuntu1_amd64.deb (--unpack):

package architecture (amd64) does not match system (i386)

Errors were encountered while processing:

/var/cache/apt/archives/gcc-6-base_6.0.1-0ubuntu1_amd64.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

The uname command outputs as follows:

uname -i
x86_64
uname -a
Linux hossein 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
2

2 Answers

Try to run this commands to enable support for the 64-bit userspace.

sudo apt-get update
sudo dpkg --add-architecture amd64
sudo apt-get update

and try to install the packages again. Also,you could try to run

dpkg --print-architecture

to move the investigation further.

5

Your processor, as quoted, works on a different architecture than the one provided by the binary inside the package. To work around this problem, you could:

As you trying to install GCC, a simple

sudo apt-get install gcc

should work from the latest stable version. If you keep getting erros, try checking this threads:

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like