I am trying to follow instruction presented here: How to install GCC 5 on debian jessie 8.1

but I am getting this error:

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.

What is the problem and how I can fix it?


What is the problem?

Installing gcc5 through apt using the pining method may break your system, because in your case there are a lot of dependencies need to be upgraded to testing. Unfortunately the required packages isn't available from backports.

how I can fix it?

You can install gcc-5.3.0 through linuxbrew (safe and tested on debian stable KDE):

install the required package:

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

Install linuxbrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"

Edit your ~/.bashrc to add ~/.linuxbrew/bin to your PATH:

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

Update and install the latest available gcc version:

brew update
brew install gcc

Verify the gcc version:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.