0

I installed Ubuntu 20.04 and I installed g++ using

sudo apt install g++ 
sudo apt install build-essential

but when I want to check the version using this command

g++ --version

it showed me and also for gcc same the situation

Command 'g++' not found, but can be installed with:

sudo apt install g++

Is there any way to check whether the g++ installed or not?

you can see the photo

Kulfy
  • 17,696

2 Answers2

0

Steps you can try:


  • Try sudo apt update before running sudo apt install g++.
  • Restart the Terminal. (If you connect via SSH, try reconnecting.)
  • Remove the g++ with sudo apt purge g++, and reinstall it.

If you want to know if the package installed, check out this answer.

ahmedg
  • 247
0

Yes you can check installed tools via this command :

sudo apt list --installed

In your case, "g++" is not installed. Try updating the repositories before installing via these commands :

sudo apt-get update -y && sudo apt-get install g++ -y