升级到 Ubuntu 14.10 后无法运行 g++

升级到 Ubuntu 14.10 后无法运行 g++

我昨天从 Ubuntu 14.04 更新到了 Ubuntu 14.10。今天我尝试运行克++-4.8像平常一样,但是出现以下错误:

make: g++-4.8: Command not found

我有同样的错误g++-4.9或者克++。我再次尝试安装 g++:

sudo apt-get install g++

但我收到以下错误信息:

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:
 g++ : Depends: g++-4.9 (>= 4.6.4-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后我尝试分布式升级

sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libc6 libc6:i386 libc6-dbg valgrind
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

安装-f

sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

但它没有改变任何东西。我清除了 gcc 和 build-essential。但是当我尝试重新安装 build-essential 时,我遇到了同样的错误:

sudo apt-get install 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: g++ (>= 4:4.4.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

编辑:我看了这个回答但删除软件包 libc6 失败:

romain@romain-N56VZ:~$ sudo apt-get remove --dry-run libc6
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:
 hunspell-fr : Depends: hunspell-fr-classical but it is not going to be installed or
                        hunspell-fr-modern but it is not going to be installed or
                        hunspell-fr-revised but it is not going to be installed or
                        hunspell-fr-comprehensive but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

答案1

好的,我修复了它:

我删除了导致错误的软件包,从 valgrind 开始:

sudo apt-get remove valgrind

然后再检查另外 3 个。之后就不再出现错误了。

相关内容