包装系统坏了。 怎么解决?
我刚刚买了一个arduino并需要gcc-avr / avrdude来编译软件。 我刚刚为另一个微处理器组件安装了avr,但显然是一个过时的版本(gcc版本3.3 20030512(预发布))所以我继续更新这些但它没有用。
(请注意,事先我通过不完整的葡萄酒装置破坏了我的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,请:) BTW,我的系统是Ubuntu 11.04
收到该错误后,请尝试使用sudo apt-get -f install
来强制安装因错误而未加载的文件。
然后再次尝试sudo apt-get update
, sudo apt-get -f install
来回sudo apt-get -f install
,直到只剩下有错误的包。
sudo dpkg --configure -a
并清理缓存
sudo apt-get clean
这通常是由于“已安装软件包的未满足依赖性”导致的。
如果你安装了’Synaptic’,这是一个简单的解决方案:
- 打开Synaptic。
- 转到“状态”(在左侧导航中)。
- 选择“破碎”。
- 删除这些破损的包裹。
否则可以通过CLI处理:
打开终端并运行以下命令:
sudo apt-get clean
上面的命令将清除检索到的包文件的本地存储库。
sudo apt-get install -f
将纠正破坏的依赖关系,即-f
这里代表“修复破坏”。
sudo dpkg --configure -a
将配置所有( -a
)尚未配置的包。 最后,运行更新命令sudo apt-get update
。
打开突触 。 然后转到状态并选择Broken 。 然后彻底清除破损的包裹。
这应该纠正你的系统。
尝试: sudo apt-get update && sudo apt-get -f install
我希望这能解决这个问题。
如果您还没有,请尝试将您的软件包存储库引用更改为“Main”或“United States” 。 这样做修复了我的Python-dev unmet-dependencies问题(我的12.04安装之前使用的是英国软件包存储库)。
- 在“Ubuntu软件中心”(USC)中,转到菜单/选项卡“编辑=>软件源”。
- 将“从下载”下拉值更改为“主服务器”或美国的服务器。
- 离开USC,从Ubuntu的程序菜单打开’Update Manager’,’Check’进行软件更新(或在终端窗口中发出’sudo apt-get update’)。
- 像往常一样更新软件,例如通过终端中的“Update Manager”或apt-get / aptitude。
这修复了我的存储库,然后我继续安装我需要的任何东西,正常情况下。
在使用上述说明纠正我的问题之前,各种aptitude / apt-get命令建议我删除许多很多包,但是,正如你可以提到的那样,我并不想丢失我6个月以上的软件包添加,这就是尽管如此我有时会对包列表进行快照(请参阅我的要点以获取提示)! 我很高兴我发现了我要离开这里的指示。
希望这可以帮助。
有同样的问题,一个
sudo apt-get clean
接着是一个
sudo apt-get update
接着是一个
sudo apt-get upgrade -f
固定它。 我希望这有帮助!