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

时间:2019-03-06 11:44:39

标签: ubuntu

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 个答案:

答案 0 :(得分:0)

您引用的处理器所使用的体系结构与软件包内部二进制文件所提供的体系结构不同。要变通解决此问题,您可以:

在尝试安装GCC时,一个简单的

sudo apt-get install gcc

应该从最新的稳定版本开始工作。如果您仍然遇到错误,请尝试检查以下线程:

https://askubuntu.com/questions/778318/how-do-i-install-gcc-6-latest-6-1-on-ubuntu-14-04-lts-make-c14-the-default https://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu

答案 1 :(得分:0)

尝试运行此命令以启用对64位用户空间的支持。

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

,然后尝试再次安装软件包。另外,您可以尝试运行

dpkg --print-architecture

进一步调查。