当我尝试在Ubuntu 12.04 LTS Server上使用安装gcc时apt-get install gcc
,出现以下错误:
The following packages have unmet dependencies:
gcc : Depends: cpp (>= 4:4.6.1-2ubuntu5) but it is not going to be installed
Depends: gcc-4.6 (>= 4.6.1-1) but it is not going to be installed
Recommends: libc6-dev but it is not going to be installed or
libc-dev
当我深入研究(即尝试apt-get install gcc-4.6
)时,我得到:
gcc-4.6 : Depends: gcc-4.6-base (= 4.6.1-9ubuntu3) but 4.6.3-1ubuntu5 is to be installed
Depends: cpp-4.6 (= 4.6.1-9ubuntu3) but it is not going to be installed
Depends: libgomp1 (>= 4.6.1-9ubuntu3) but it is not going to be installed
Depends: libquadmath0 (>= 4.6.1-9ubuntu3) but it is not going to be installed
Recommends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed
因此,当我尝试安装时gcc-4.6=4.6.1-9ubuntu3
,会列出366个要删除的软件包(包括apt
)。这是疯狂的。
这实际上是Ubuntu 12.04 LTS Server的原始安装(即,我安装了nginx,python-flup,python-yaml,rsync,python-pkg-resources,lsof,fontconfig,iptables,ufw,scons和grc)。
我无法安装gcc,这使我感到非常惊讶,因此我对为什么尝试安装gcc失败感到困惑。唯一明显的解决方法似乎是卸载366个软件包,其中许多对于Ubuntu的操作至关重要。
事情没有加在一起,我将非常感谢您的帮助。
编辑上面是带有最新软件包的,当然apt-get update; apt-get upgrade
在尝试上述操作之前已经使用过。抱歉,我应该提到这一点。