Thursday, September 28, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  0] [ 0]  / answers: 1 / hits: 6066  / 2 Years ago, wed, october 6, 2021, 7:52:08

I have just installed gcc 4.7 from ppa repository. Ubuntu 12.04 already comes with 4.6. When I use command:

gcc --version

It tells me it is 4.6.3 to be exact.

I have no idea of how to launch the 4.7 compiler. In fact, I wouldn't mind erasing the former version and stay with 4.7 only (I guess that wouldn't be a problem).

How can I fix this?

More From » gcc


Use update-alternatives (from CLI) or galternatives (from GUI) to set the default for gcc.

If you don't have them, install with: sudo apt-get install galternatives.

I would use the GUI version, it is more simple for a beginner.

From CLI:

sudo update-alternatives --install /usr/bin/gcc gcc /path/to/newer/gcc 40

sudo update-alternatives --install /usr/bin/gcc gcc /path/to/older/gcc 30

sudo update-alternatives --config gcc

[#35291] Friday, October 8, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 346
Total Questions: 115
Total Answers: 105

Location: Oman
Member since Wed, Apr 12, 2023
6 Months ago