1. Update the package list:

    sudo apt update
  2. Install g++:

    sudo apt install g++
  3. Verify the installation: After installation, you can verify that g++ is installed by checking the version:

  4. g++ --version

  5. Go there more details 

This will display the installed version of the g++ compiler.