I am reading an article on raspberry pi on a local magazine and they do this

sudo apr-get install gcc-4.8 g++-4.8
sudo rm -rf /usr/bin/gcc
sudo rm -rf /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++

I understand that here they are replacing the default gcc and g++ with a recently installed 4.8 version

What version of gcc does the raspberry pi 2 and 3 come with originally?

(The above commands are not required on a rasp pi 1 or zero-- wonder why?)


3 Answers 3


Strictly speaking, Raspberry Pi comes with no software. The gcc version will depend on which distribution of Linux (or other OS) you take and exactly when you take it. Most Linux distribution images periodically update to new versions.

That being said, my Pi running up-to-date Raspian has version

 gcc (Raspian 4.9.2-10) 4.9.2

as of this moment (Aug 30, 2017).


The default version of the GCC are as follows:

  • Raspbian Stretch: GCC 6.3.0
  • Raspbian Jessie: GCC 4.9.2 (GCC 4.8.4 available)
  • Raspbian Wheezy: GCC 4.6.3 (GCC 4.4.7 and 4.7.2 available)

g++ always gets the same version number as GCC, since it is part of the same software project.


Dowload the file from here: http://archive.raspbian.org/raspbian/dists/stretch/main/binary-armhf/Packages

and run cat Packages | grep "Package: gcc*"

You should see:

Package: gcc-6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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