我最近尝试降级到 gcc 4.7,因为我正在处理的 cfd 代码没有用最新的 gcc 版本编译。但是在经历了很多错误并且代码仍然没有编译之后,我放弃了,并想回到最新的 gcc 和 g++ 编译器,但似乎我可能搞砸了一些事情。
当我做:
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get install gcc-6.2 g++-6.2
Run Code Online (Sandbox Code Playgroud)
甚至 gcc-5.1 g++-5.1 就此事而言,它给了我以下错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-6.2
E: Couldn't find any package by glob 'gcc-6.2'
E: Couldn't find any package by regex 'gcc-6.2'
E: Unable to locate package g++-6.2
E: Couldn't find any package by glob 'g++-6.2'
E: Couldn't find any …Run Code Online (Sandbox Code Playgroud)