0

I would like to install gcc-5 on my local machine. But I am encountering some issues. When I type the following command:

sudo zypper install gcc-5

I got the following answer

Loading repository data...

Reading installed packages...

Package 'gcc-5' not found.

Resolving package dependencies...

Nothing to do.

It is strange because when I type the following command:

cnf gcc-5

I got the following answer:

Program 'gcc-5' is present in package 'gcc5', which is installed on your system.

Absolute path to 'gcc-5' is '/usr/bin/gcc-5'. Please check your $PATH variable to see whether it contains the mentioned path.

And when I want to check which gcc version is installed on my computer with the following command:

gcc --version

I have the following answer:

If 'gcc' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf gcc

How do I get GCC-5 properly installed and how could I check which version is installed/used by my computer? Thank you

info: I use openSUSE with Xfce terminal

1 Answer 1

2

GCC 5 is installed, but the executable is called gcc-5, not gcc.

You may either create a symlink from gcc-5 to gcc in /usr/bin (but moving gcc out of the way first if it exists!), or (which may be preferable since it wouldn't include messing about with things installed by a package manager), just use gcc-5.

For the command line, you could set up an alias:

alias gcc=gcc-5

In most Makefiles, the compiler is picked from the CC Makefile variable, so setting this to gcc-5 would also work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .