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?
52 Answers
Steps you can try:
- Try
sudo apt updatebefore runningsudo apt install g++. - Restart the Terminal. (If you connect via SSH, try reconnecting.)
- Remove the
g++withsudo apt purge g++, and reinstall it.
If you want to know if the package installed, check out this answer.
2Yes 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
