由于未满足依赖关系,无法安装 gcc-4.8

由于未满足依赖关系,无法安装 gcc-4.8

我试图升级gcc-4.8.1gcc-4.8.2使用突触此 PPA。安装过程没有出现任何问题,但突然我根本没有 gcc-4.8。我同时使用了 gcc-4.7 和 gcc-4.8,但由于某种原因,只剩下 4.7。然后我尝试使用重新安装 gcc-4.8,apt-get install但我得到了未满足的依赖关系错误。我尝试使用以下方法解决这个问题这个问题的答案,但无济于事。

sudo apt-get install gcc-4.8

结果是:

...
The following packages have unmet dependencies:
 gcc-4.8 : Depends: binutils (>= 2.23.90.20131017) but
2.23.52.20130913-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

以下是输出:

martin@martin-Studio-1537:~$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu saucy main universe restricted multiverse
deb http://security.ubuntu.com/ubuntu/ saucy-security main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu saucy-updates main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu saucy-proposed main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu saucy main universe restricted multiverse #Added by software-properties
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu saucy main

martin@martin-Studio-1537:~$ cat /etc/apt/sources.list.d/*
# deb http://download.mendeley.com/apt/ stable main
deb http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
deb-src http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
deb http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
# deb-src http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu saucy main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu saucy main
# deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main
# deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main
# deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main
# deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main

我尝试在回答后重复这些建议禁用所有 PPA然后再次使用 gcc-4.8.2 PPA已启用但我仍然无法安装 gcc-4.8.2。

我做错了什么?我该如何修复我的系统?

编辑:

我试过

martin@martin-Studio-1537:~$ sudo apt-get install -f
[sudo] password for martin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

进而

sudo apt-get update

但结果是一样的。

我尝试了一切这个答案除清除或移除 PPA 外。

编辑2:

我遵循了searchforgold6789 的回答它确实起作用了!我成功安装了 gcc-4.8.1。但是当我再次添加 PPA 并尝试升级时,我得到了以下输出:

The following packages have been kept back:
  cpp-4.8 g++-4.8 gcc-4.8 gcc-4.8-base libasan0 libatomic1 libgcc-4.8-dev
  libgcc1 libgcc1-dbg libgfortran3 libgomp1 libitm1 libquadmath0
  libstdc++-4.8-dev libstdc++6 libstdc++6-4.8-dbg
The following packages will be upgraded:
  libcloog-isl4 libisl10
2 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.

编辑3:

当我这样做时,apt-get dist-upgrade它建议 g++-4.8 gcc-4.8 应该是已删除。为什么会这样?我还要继续吗?我想这就是我陷入困境的根本原因。

martin@martin-Studio-1537:~$ sudo apt-get dist-upgrade
...
The following packages will be REMOVED:
  g++-4.8 gcc-4.8
The following packages will be upgraded:
  cpp-4.8 gcc-4.8-base libasan0 libatomic1 libgcc-4.8-dev libgcc1 libgcc1-dbg
  libgfortran3 libgomp1 libitm1 libquadmath0 libstdc++-4.8-dev libstdc++6
  libstdc++6-4.8-dbg
14 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 14.9 MB of archives.
After this operation, 32.4 MB disk space will be freed.

答案1

首先,您应该清理旧的 ppa......

sudo apt-get install ppa-purge 
sudo ppa-purge ppa:ubuntu-toolchain-r/test

然后,进入软件源,确保你有宇宙多元宇宙已启用存储库。请执行以下操作:

sudo apt-get update

然后你应该能够安装gcc-4.8

sudo apt-get install gcc-4.8

此后,如果您无法添加 PPA 并再次尝试使用 GCC 4.8.2,我会感到非常惊讶。

答案2

尝试 :

apt-get install -f

apt-get update 

相关内容