我最近刚买了一个 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”,这里有一个简单的解决方案:
- 打开 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
我希望这能解决问题。