When i enter following command in the terminal:
gcc --version
It's output something like this:
gcc (Ubuntu 6.5.0-2ubuntu1~18.04) 6.5.0 20181026
...
But when i enter below command to see version of the installed gcc package:
apt-cache show gcc | grep Version
I see this:
Version: 4:7.4.0-1ubuntu2.2
Version: 4:7.3.0-3ubuntu2.1
Version: 4:7.3.0-3ubuntu2
Is it normal?
Which version used by software that needs gcc?
gcc is installed on your Ubuntu (18.04, 18.10 or 19.04) as well gcc-6 and possibly some other gcc version(s). Although gcc is installed, gcc-6 is currently the default version of gcc. To show all the versions of gcc installed on your OS, run the following command:
As you can see from the results of the above command, there are several different alternative versions of gcc in the default Ubuntu repositories, and multiple versions of gcc can be installed alongside each other. You can select which version of gcc to use if multiple versions are installed by following the instructions in How to use multiple instances of gcc?.
/usr/bin/gcc
is normally a symbolic link, and it normally points to the default current version ofgcc
for your system - which in your case appears to begcc-7.4.0
If the link is pointing to a different version, that's likely because it has been linked manually using
ln
, or via theupdate-alternatives
system.Software doesn't "need"
gcc
at runtime - so it would only affect what version of the compiler is used when you build software from sources.