2014-11-22 284 views
0

我的Raspberry Pi不會再安裝任何東西,因爲它一直在抱怨半裝libc6。例如,當我嘗試安裝G ++ 4.7:Raspberry Pi Libc損壞

[email protected] ~/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

看起來你添加錯庫到你的/etc/apt/sources.list或/etc/apt/sources.list.d/*, 看看

cat /etc/apt/sources.list /etc/apt/sources.list.d/* 

應該沒有debian的回購協議在源列表,同時檢查raspbian版本,看起來像你的「喘息」,因此將其刪除「SID」或「傑西」,當你解決它,不要

sudo apt-get update 
sudo apt-get -f install 

如果您的sources.list是正確的,你應該學會不從隨機站點安裝debs。

我們解決您的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/* 
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