build-essential : Depends: libc6-dev but it is not going to be installed or libc-dev 解决办法

总结自:http://unix.stackexchange.com/questions/24432/debian-6-squeeze-installing-build-essentials-gcc-g

在Linux下面想要安装build-essential的时候,可能会报错:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: gcc (>= 4:4.4.3) but it is not going to be installed
                   Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Broken packages

大概是这样的形式(这也是别人的)

解决方法(翻译大概如下):

所使用debian系统是稳定(Debian stable or Debian squeeze)和不稳定(Debian testing or Debian wheezy)的混合状态。在这种情况下,source.list中的源的内容就不能是squeeze状态的,而要全部改成不稳定状态才行。

所以引用中给出的建议是,将/etc/apt/source.list中的所有【stable】或者【squeeze】都改成【tesing】或【wheezy】或【unstable】或【sid】。

然后我就把source.list中的所有【squeeze】都批量替换成【testing】。

然后:

apt-get update
apt-get upgrade
apt-get install build-essential

这极端更新会比较多,要稍微等一下就好了。

下面的别人的原文:

You appear to have a mixture of Debian stable (squeeze) and Debian testing (wheezy) or unstable (sid). Specifically, your libc6 package is the testing/unstable version, but your package sources point to stable.

You need to pick a distribution between stable, testing and unstable — you can't really mix them (you can mix testing and unstable if you don't mind the occasional annoyance, but stable is too far apart).

If you pick stable, you need to downgrade your system. Downgrading is supported by apt-get, but you can expect some pain as not all packages support downgrading. Since you're new to Debian, I recommend reinstalling unless you've already customized your system a lot. You can save and restore your home directory; also back up the /etc directory, but restore files from it only on a case-by-case basis.

If you pick testing or unstable, edit your software sources in /etc/apt/sources.list to have testing or wheezy or unstable or sid where it now says stable or squeeze.

You're right that installing the build-essential package is a good way to install development tools, by the way. And gcc is the de facto standard C and C++ compiler on Linux; you would only use another if you had very special requirements.

 

 

 

 

 

 

 

 

 

 

 

Bon Appetite~

 

转载于:https://www.cnblogs.com/zhawj159753/p/3984629.html

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值