Update the version of gcc/ g++ to 8
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-8 g++-8
# point gcc under /usr/bin/gcc to /usr/bin/gcc-8
# give it a priority 20
# --slave makes sure that gcc updates any link then g++ follows suit and stays in sync
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 20 --slave /usr/bin/g++ g++ /usr/bin/g++-8