軟體包系統已損壞。如何修復它?

軟體包系統已損壞。如何修復它?

我最近剛買了一個arduino,需要gcc-avr/avrdude來編譯軟體。我不久前為另一個微處理器元件安裝了 avr,但顯然是一個過時的版本(gcc 版本 3.3 20030512(預發布)),所以我繼續更新它們,但它不起作用。

(請注意,之前我還通過不完整的 wine 安裝破壞了我的 aptdaemon(無法通過字體安裝協議),但我通過重新安裝然後接受協議修復了這個問題。)

我正在嘗試透過運行來更新這些bingo 的建置腳本但由於 avr... 終端報告,無法安裝它所需的依賴項

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
libncurses5-dev is already the newest version.
libncurses5-dev set to manually installed.
libusb-0.1-4 is already the newest version.
libx11-dev is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
arduino-core : Depends: gcc-avr but it is not going to be installed
avr-libc : Depends: gcc-avr (>= 1:4.3.4) but it is not going to be installed
Depends: binutils-avr (>= 2.20) but it is not going to be installed
binutils-dev : Depends: binutils (= 2.21.0.20110327-2ubuntu3) but 2.21.0.20110327-2ubuntu2 is to be installed
libcwidget-dev : Depends: libcwidget3 (= 0.5.16-3ubuntu2) but it is not going to be installed
Depends: libsigc++-2.0-dev but it is not going to be installed
Depends: libncursesw5-dev but it is not going to be installed
libmpfr-dev : Depends: libgmp3-dev (>= 4.2.dfsg-1) but it is not going to be installed
python-dev : Depends: python (= 2.7.1-0ubuntu5.1) but 2.7.1-0ubuntu5 is to be installed
Depends: python2.7-dev (>= 2.7.1-1~) but it is not going to be installed
tk8.4-dev : Depends: tk8.4 (= 8.4.19-4) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

但跑步

apt-get -f install

結果是

(Reading database ... 163021 files and directories currently installed.)
Unpacking binutils-avr (from .../binutils-avr_2.20.1-1ubuntu2_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/binutils-avr_2.20.1-1ubuntu2_i386.deb (--unpack):
trying to overwrite '/usr/bin/avr-size', which is also in package avr-binutils 2.13.90.030512-2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking gcc-avr (from .../gcc-avr_1%3a4.3.5-1_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/gcc-avr_1%3a4.3.5-1_i386.deb (--unpack):
trying to overwrite '/usr/bin/avr-g++', which is also in package avr-gcc-c++ 3.2.90.20030512-2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/binutils-avr_2.20.1-1ubuntu2_i386.deb
/var/cache/apt/archives/gcc-avr_1%3a4.3.5-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我嘗試運行更新管理器並透過它更新我的系統,但我得到的只是一條錯誤訊息

The following packages have unmet dependencies:
arduino-core: Depends: gcc-avr but it is not installed
avr-libc: Depends: gcc-avr (>= 1:4.3.4) but it is not installed
Depends: binutils-avr (>= 2.20) but it is not installed

然後告訴我嘗試運行 apt-get -f install ,結果與上次相同。

那我該如何修復我的系統,我真的需要新的 avr,拜託:)順便說一句,我的系統是 Ubuntu 11.04

答案1

出現該錯誤後,請嘗試sudo apt-get -f install強制安裝由於該錯誤而未載入的檔案。

然後sudo apt-get update再重試,sudo apt-get -f install來來回回,直到只剩下有錯誤的包。

sudo dpkg --configure -a

並清理緩存

sudo apt-get clean

答案2

這通常是由於「已安裝的軟體包未滿足依賴關係」而發生的。

如果您安裝了“Synaptic”,這是一個簡單的解決方案:

  • 打開突觸。
  • 轉到“狀態”(位於左側導覽列)。
  • 選擇“損壞”。
  • 刪除這些破損的包裹。

否則可以透過 CLI 處理:

打開終端機並執行以下命令:

sudo apt-get clean

上面的命令將清除檢索到的套件檔案的本機儲存庫。

sudo apt-get install -f

將糾正損壞的依賴關係,即-f這裡代表「修復損壞的」。

sudo dpkg --configure -a

將配置所有 ( -a) 尚未配置的套件。最後運行更新命令sudo apt-get update

答案3

打開突觸安裝突觸。然後進入狀態並選擇破碎的。然後完全取出破損的包裹。

這應該會糾正您的系統。

在此輸入影像描述

答案4

嘗試:sudo apt-get update && sudo apt-get -f install
我希望這能解決問題。

相關內容