我的Raspberry Pi将不再安装任何东西,因为它一直在抱怨半安装的libc6。例如,当我尝试安装g ++ 4.7时:
pi@raspberrypi ~/workspace $ sudo apt-get install g++-4.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
g++-4.7 : Depends: libstdc++6-4.7-dev (= 4.7.2-5+rpi1) but it is not going to be installed
libkrb5-3 : Depends: libc6 (>= 2.16) but 2.13-38+rpi2+deb7u3 is to be installed
locales : Depends: glibc-2.19-1 but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
所以,然后我运行sudo apt-get install -f
,它给了我这个错误:
dpkg: error processing libc6:armhf (--configure):
package libc6:armhf is not ready for configuration
cannot configure (current status `half-installed')
Errors were encountered while processing:
libc6:armhf
E: Sub-process /usr/bin/dpkg returned an error code (1)
我该怎么办?
答案 0 :(得分:0)
看起来您在/etc/apt/sources.list或/etc/apt/sources.list.d/*中添加了错误的存储库, 看看
cat /etc/apt/sources.list /etc/apt/sources.list.d/*
在源列表中应该没有debian repos,也检查raspbian版本,看起来你在“wheezy”,所以删除“sid”或“jessie”,当你修复它时,做
sudo apt-get update
sudo apt-get -f install
如果您的sources.list是正确的,您应该学会不从随机网站安装deb。
现在修复你的libc6,重新安装它
wget https://archive.raspbian.org/raspbian/pool/main/e/eglibc/libc6-dev_2.13-38%2brpi2%2bdeb7u3_armhf.deb
sudo dpkg -i --force-all libc6-dev_2.13-38+rpi2+deb7u3_armhf.deb
sudo apt-get -f install
如果您难以修复sources.list或没有帮助,请提供以下命令的输出
apt-cache policy libc6
apt-cache policy libc6-dev
cat /etc/apt/sources.list /etc/apt/sources.list.d/*
答案 1 :(得分:0)
从2015年的图片
开始,这对我来说很好wget https://archive.raspbian.org/raspbian/pool/main/e/eglibc/libc6-dev_2.13-38%2brpi2%2bdeb7u3_armhf.deb
sudo dpkg -i --force-all libc6-dev_2.13-38+rpi2+deb7u3_armhf.deb
sudo apt-get -f install