当 sudo apt-get -f install 时,我收到以下错误,如何修复它

当 sudo apt-get -f install 时,我收到以下错误,如何修复它
Preconfiguring packages ...
dpkg: error processing /var/cache/apt/archives/gcc-4.8-base_4.8.2-19ubuntu1_amd64.deb 
(--unpack):
 package architecture (amd64) does not match system (i386)

Errors were encountered while processing:
 /var/cache/apt/archives/gcc-4.8-base_4.8.2-19ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

在我看来,您好像试图将 64 位软件包安装到 32 位操作系统中,但安装失败了。您告诉我您要安装什么,我会告诉您安装的简单方法,如何?

再仔细研究一下你的帖子。GCC 似乎代表 gnu 编译器集合。据我所知,ubuntu 中已经安装了它,所以你似乎试图安装一些你应该已经拥有的东西。

答案2

检查你的 /boot 目录...它可能已满

$> df -H

如果已完成,请按照以下指南操作: 如何删除旧内核版本来清理启动菜单?

希望这可以帮助!

答案3

错误消息显示您的机器是i386架构,并且您正在尝试安装针对该架构的包amd64。要解决此问题,请打开终端并执行以下操作:

1)清理 apt 缓存:( sudo apt-get clean 由于缓存中有错误的文件,因此请用此方法将其删除)

2)检查你的软件包是否已安装(不需要,只是为了了解):gcc

如果没有安装,你将得到以下输出

$ gcc
The program 'gcc' is currently not installed. You can install it by typing:
sudo apt-get install gcc

3)安装你的包sudo apt-get install gcc

现在输出将如下所示

$ sudo apt-get install gcc
[sudo] password for adwaita: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
    g++-4.8 gfxboot gfxboot-dev libfribidi-bin libstdc++-4.8-dev mktemp re2c
    squashfs-tools
Use 'apt-get autoremove' to remove them.
   Suggested packages:
    gcc-multilib automake1.9 flex bison gcc-doc
The following NEW packages will be installed:
         gcc
0 upgraded, 1 newly installed, 0 to remove and 67 not upgraded.
Need to get 5,098 B of archives.
After this operation, 42.0 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/main gcc amd64 4:4.8.2-1ubuntu6 [5,098 B]
Fetched 5,098 B in 0s (5,626 B/s)                      
Selecting previously unselected package gcc.
(Reading database ... 284177 files and directories currently installed.)
Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking gcc (4:4.8.2-1ubuntu6) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up gcc (4:4.8.2-1ubuntu6) ...

你完成了。

相关内容