I installed gcc 9 using
sudo add-apt-repository ppa:jonathonf/gcc-9.0
sudo apt-get install gcc-9
But running gcc -v (after restart) still gave the output of 7.4.0.
Additionally, I tried uninstalling gcc
sudo apt-get --purge remove gcc-7
and then installing gcc -9, but then running gcc -v says no file/directory found.
update-alternatives
) it's often simpler to just callgcc-9
explicitly when you need it.gcc-9 -v
would return info..sudo update-alternatives --config gcc
can select version.