總結自:http://unix.stackexchange.com/questions/24432/debian-6-squeeze-installing-build-essentials-gcc-gapp
在Linux下面想要安裝build-essential的時候,可能會報錯:less
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
大概是這樣的形式(這也是別人的)ui
解決方法(翻譯大概以下):spa
所使用debian系統是穩定(Debian stable or Debian squeeze)和不穩定(Debian testing or Debian wheezy)的混合狀態。在這種狀況下,source.list中的源的內容就不能是squeeze狀態的,而要所有改爲不穩定狀態才行。翻譯
因此引用中給出的建議是,將/etc/apt/source.list中的全部【stable】或者【squeeze】都改爲【tesing】或【wheezy】或【unstable】或【sid】。unix
而後我就把source.list中的全部【squeeze】都批量替換成【testing】。rest
而後:code
apt-get update apt-get upgrade apt-get install build-essential
這極端更新會比較多,要稍微等一下就行了。orm
下面的別人的原文:blog
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~