I have gcc 7.3.0
on Ubuntu 18.04.
But I am working on a project where I need gcc less than version 6.
When I tried to install gcc 5.4 using sudo apt install gcc-5.4
, I got this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-5.4
E: Couldn't find any package by glob 'gcc-5.4'
E: Couldn't find any package by regex 'gcc-5.4'
What is the appropriate way to install gcc 5.4?
sudo apt install gcc-5
– steeldriver Oct 25 '18 at 14:24apt search gcc-5
orapt search gcc-6
– abu-ahmed al-khatiri Oct 25 '18 at 14:25gcc --version
, I still get 7.3.0 – singrium Oct 25 '18 at 14:29/usr/bin/gcc
will still point togcc-7
. You can either change the symlink (manually - or viaupdate-alternatives
) or simply callgcc-5
explicitly when you need it – steeldriver Oct 25 '18 at 14:40update-alternatives
– singrium Oct 25 '18 at 15:09