install gcc 4.8.5 and g++ 4.8.5 on ubuntu 16.04 LTS 1 add code below for update /etc/apt/sources.list deb http://cz.archive.ubuntu.com/ubuntu xenial main universe 2 install gcc-4.8 sudo apt-get install gcc-4.8 3 install g+±4.8 sudo apt-get install g+±4.8 4 Setup gcc and g++ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g+±4.8 5 switch gcc and g++ version sudo update-alternatives --config gcc