rvbarreto
rvbarreto

Reputation: 691

g++ is installed but when I try to run it I'm told it is not installed

I'm using ubuntu 16.04 and I have g++ installed:

~$ sudo apt install g++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
g++ is already the newest version (4:5.3.1-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

However, when I try to use it to compile, or if I just call it, I receive an error message stating that g++ is not installed.

~$ g++
The program 'g++' is currently not installed. You can install it by typing:
sudo apt install g++

I already tried apt update and apt upgrade but nothing changes. Build essential package is also installed:

~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

How can I have g++ working?

Upvotes: 1

Views: 330

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385144

Something is wrong with the installation, or it has since been modified/broken.

Reinstall it.

sudo apt-get install --reinstall g++

Upvotes: 2

Related Questions