Celeb Glow
updates | March 21, 2026

Command 'gcc' not found, but can be installed with.. ubuntu 18.04

Hi, because my default gcc could not, not long ago I've installed a new gcc to compile assembly files

sudo apt install gcc-4.8

Now, in order to command gcc-4.8 SomeProgram.s with gcc SomeProgam.s I've directed my gcc to gcc-4.8 (or so I thought..)

I've used the following commands (after installing gcc-4.8):

$ sudo rm usr/bin/gcc
$ sudo ln -s usr/bin/gcc-4.8 /usr/bin/gcc

But now I get this message upon trying to get gcc to compile

Command 'gcc' not found, but can be installed with:
sudo apt install gcc

gcc-4.8 SomeProgram.s still works.

Upon installing gcc again I get info that implies that I already have gcc

But seems like I can't use it.So it must be a problem with the pointing.

Please help me get my gcc back. Please help me direct the gcc command to gcc-4.8.

Thanks in advanced.

2

1 Answer

Sorry I can't comment yet.

But I must point out that the original ln command is incorrect, which creates an incorrect relative link usr/bin/gcc-4.8 under /usr/bin/

Correct command is

sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc

or

sudo ln -s gcc-4.8 /usr/bin/gcc
4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy