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?
Thanks to @steeldriver, I could solve the problem as following:
Install gcc and g++
Change the symlink to point to gcc 5 and g++ 5
Credits: How to choose the default gcc and g++ version?