包系统坏了。如何解决?

Vig*_*igi 76 package-management apt software-installation

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

(请注意,在此之前,我还通过不完整的 wine 安装破坏了我的 aptdaemon(无法通过字体安装协议),但我通过重新安装修复了该问题,然后接受了协议。)

我正在尝试通过运行宾果游戏的构建脚本来更新这些,但由于 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).
Run Code Online (Sandbox Code Playgroud)

但是跑步

apt-get -f install
Run Code Online (Sandbox Code Playgroud)

结果是

(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)
Run Code Online (Sandbox Code Playgroud)

我试过运行更新管理器并通过它更新我的系统,但我得到的只是一条错误消息

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
Run Code Online (Sandbox Code Playgroud)

然后告诉我尝试运行 apt-get -f install ,结果与上次相同。

那么我该如何修复我的系统,我真的需要新的 avr,请:) 顺便说一句,我的系统是 Ubuntu 11.04

Rin*_*ail 68

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

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

sudo dpkg --configure -a

并清理缓存

sudo apt-get clean

  • 感谢您的回答,但正如您发布的那样,我找到了一个解决方案:PI 打开了突触包管理器并过滤掉了两个损坏的包,然后我用 SPM 删除了它们,现在一切都运行得很顺利。设法安装了依赖项,我现在正在使用宾果游戏的脚本安装 avr!:) 还没有完成,但如果失败了,我会试试你的答案 (3认同)

小智 27

这通常是由于“未满足已安装软件包的依赖项”而发生的。

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

  • 打开突触。
  • 转到“状态”(在左侧导航中)。
  • 选择“破碎”。
  • 删除这些损坏的包。

否则可以通过 CLI 处理:

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

sudo apt-get clean
Run Code Online (Sandbox Code Playgroud)

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

sudo apt-get install -f
Run Code Online (Sandbox Code Playgroud)

将纠正损坏的依赖项,即-f这里代表“修复损坏”。

sudo dpkg --configure -a
Run Code Online (Sandbox Code Playgroud)

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


小智 17

打开突触安装突触. 然后转到状态并选择Broken。然后完全取出破损的包裹。

这应该更正您的系统。

在此处输入图片说明


小智 6

有同样的问题,一个

sudo apt-get clean
Run Code Online (Sandbox Code Playgroud)

紧随其后的是

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

紧随其后的是

sudo apt-get upgrade -f
Run Code Online (Sandbox Code Playgroud)

修复。我希望这有帮助!