當 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) ...

你完成了。

相關內容