在 Debian 上安装 gcc 5 时出现问题

在 Debian 上安装 gcc 5 时出现问题

我正在尝试遵循此处提供的说明:如何在 debian jessie 8.1 上安装 GCC 5

但我收到此错误:

sudo apt-get install -t testing gcc
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:
 gsettings-desktop-schemas : Breaks: gnome-settings-daemon (< 3.19.92) but 3.14.2-3 is to be installed
                             Breaks: mutter (< 3.19.92) but 3.14.4-1~deb8u1 is to be installed
 gstreamer1.0-plugins-base : Breaks: gstreamer1.0-plugins-bad (< 1.7.90) but 1.4.4-2.1+deb8u1 is to be installed
 libgstreamer-plugins-base1.0-0 : Breaks: gstreamer1.0-plugins-bad (< 1.7.1) but 1.4.4-2.1+deb8u1 is to be installed
 libpam-systemd : Depends: systemd (= 215-17+deb8u6) but 232-15 is to be installed
 libvlccore8 : Breaks: vlc (< 2.2.4-7~) but 2.2.4-1~deb8u1 is to be installed
               Breaks: vlc-nox (< 2.2.4-7~) but 2.2.4-1~deb8u1 is to be installed
 systemd-sysv : Depends: systemd (= 215-17+deb8u6) but 232-15 is to be installed
 task-cinnamon-desktop : Depends: cinnamon-desktop-environment but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

有什么问题以及如何解决它?

答案1

问题是什么?

gcc5通过apt使用该方法安装pining可能会破坏您的系统,因为在您的情况下有很多依赖项需要升级到testing.不幸的是,向后移植无法提供所需的软件包。

我该如何修复它?

您可以gcc-5.3.0通过安装linuxbrew(安全并在 Debian 稳定版 KDE 上经过测试):

安装所需的包:

sudo apt-get install build-essential curl git python-setuptools ruby

安装linuxbrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
PATH="$HOME/.linuxbrew/bin:$PATH"

编辑您的~/.bashrc以添加~/.linuxbrew/bin到您的路径:

echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bashrc

更新并安装最新的可用gcc版本:

brew update
brew install gcc

验证gcc版本:

#gcc --version
gcc (Homebrew gcc 5.3.0) 5.3.0

相关内容