当前位置: 首页>>技术问答>>正文


包装系统坏了。怎么解决?

, , ,

问题描述

我刚刚买了一个arduino并需要gcc-avr /avrdude来编译软件。我刚刚为另一个微处理器组件安装了avr,但显然是一个过时的版本(gcc版本3.3 20030512(预发布))所以我继续更新这些,但它没有用。

(请注意,事先我通过不完整的葡萄酒装置破坏了我的aptdaemon(无法通过字体安装协议)但我通过re-installation修复了这个,然后接受了协议。)

我试图通过运行bingo’s build script更新这些,但由于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,请:) BTW,我的系统是Ubuntu 11.04

最佳解决办法

收到该错误后,请尝试使用sudo apt-get -f install强制安装因错误而未加载的文件。

然后再次尝试sudo apt-get update,来回sudo apt-get -f install,直到只剩下有错误的包。

sudo dpkg --configure -a

并清理缓存

sudo apt-get clean

次佳解决办法

这通常是由于“已安装软件包的未满足依赖性”导致的。

如果您安装了’Synaptic’,这是一个简单的解决方案:

  • 打开Synaptic。

  • 转到’Status'(在左侧导航中)。

  • 选择’Broken’。

  • 删除这些破损的包裹。


否则可以通过CLI处理:

打开终端并运行以下命令:

sudo apt-get clean

上面的命令将清除检索到的包文件的本地存储库。

sudo apt-get install -f

将纠正破坏的依赖关系,即-f在这里代表“fix broken”。

sudo dpkg --configure -a

将配置所有(-a)尚未配置的软件包。最后,运行更新命令sudo apt-get update

第三种解决办法

打开突触。然后转到状态并选择Broken。然后彻底清除破损的包裹。

apt,package-management,software-installation,ubuntu

这应该纠正你的系统。

apt,package-management,software-installation,ubuntu

第四种办法

试试:sudo apt-get update && sudo apt-get -f install我希望这能解决这个问题。

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/2218.html,未经允许,请勿转载。