I am trying to update gcc version in debian pc, but no luck yet.

I have followed the instruction given in this answer and changed the last command to apt-get install gcc-5.4 g++-5.4 but it seems no installable package is available for latest gcc verion. Even aptitude search gcc-5 does not list anything.

EDIT : Adding output of cat /etc/*-release

PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION="8 (jessie)"
  • Please add the output of cat /etc/*-release – schaiba Oct 20 '16 at 11:54
  • @schaiba : I have added it's output in question. – Shravan40 Oct 20 '16 at 11:56
  • 7
    Those instructions you are quoting are for Ubuntu. On Debian 8 gcc5 is not available. Please see unix.stackexchange.com/questions/284817/… . – schaiba Oct 20 '16 at 11:59

Latest version of gcc can be installed from from testing on debian jessie using apt-pinning:

cd /etc/apt/sources.list.d/
touch testing.list

Add this deb http://ftp.us.debian.org/debian testing main contrib non-free to file testing.list

Now move into directory


And add this

Package: *
Pin: release a=testing
Pin-Priority: 100

to newly created file testing.list.

apt-get update
sudo apt-get install -t testing gcc

Note that using -t testing you tell apt-get to install gcc from testing sources as configured in above steps.

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