【问题标题】:Raspberry Pi Libc corruptedRaspberry Pi Libc 已损坏
【发布时间】:2015-03-05 07:17:05
【问题描述】:

我的 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)

对此我能做些什么?

【问题讨论】:

    标签: linux raspberry-pi libc


    【解决方案1】:

    看起来您在 /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 是正确的,你应该学会不要从随机站点安装 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/*
    

    【讨论】:

      【解决方案2】:

      从 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
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-03-29
        • 1970-01-01
        • 2018-10-23
        • 1970-01-01
        • 1970-01-01
        • 2012-04-28
        • 1970-01-01
        • 2011-09-17
        相关资源
        最近更新 更多