我尝试这样做:
$ g++
The program 'g++' is currently not installed. You can install it by typing:
sudo apt-get install g++
$ sudo apt-get install g++
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
答案1
这可能表明您已经安装g++
然后在某个时候手动删除了实际的 g++ 二进制文件或其符号链接。
您可以通过运行 apt-get install 并使用以下选项强制重新安装(包括重新创建符号链接)--reinstall
:
sudo apt-get install --reinstall g++