我正在尝试编译Cuda 10.2,并且可以预见gcc-10将无法编译它。当使用20.04很简单,添加仿生回购,更新,安装,更新-替代。用21.04我什么也做不了。
我尝试了异种和仿生的“主”和“宇宙”回复,这给PUBKEY带来了一个错误。我从ubuntu密钥服务器获得了PUBKEY,并更新了包列表,没有错误。
sudo apt install g++-6
Package g++-6 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'g++-6' has no installation candidatesources.list ->
deb http://archive.ubuntu.com/ubuntu hirsute restricted main multiverse universe
deb http://archive.ubuntu.com/ubuntu hirsute-updates restricted main multiverse universe
deb http://archive.ubuntu.com/ubuntu hirsute-security restricted main multiverse universe
# gcc-6
deb [allow-insecure=yes] http://dk.archive.ubuntu.com/ubuntu/ bionic main universe
#deb [allow-insecure=yes] http://dk.archive.ubuntu.com/ubuntu/ xenial main universe有人知道我如何使用Ubuntu21.04实现这个目标吗?我读过的每一篇文章都说要添加仿生或异种回复,更新,安装。到目前为止我还没有运气。
发布于 2021-10-21 20:41:20
我抓取了浏览Ubuntu 这里所需的软件包(.deb)。
下面列出了手动安装gcc/g++ 6所需的.deb软件包。按列表顺序安装。这假设您拥有编译所需的大多数工具,并且只需要切换默认的gcc版本。
sudo apt install ./libisl19_0.19-1_amd64.deb
sudo apt install ./gcc-6-base_6.4.0-17ubuntu1_amd64.deb
sudo apt install ./cpp-6_6.4.0-17ubuntu1_amd64.deb
# you can grab this next package from 21.04 repos, it handles a lot of the dependancies.
sudo apt install libgcc-6-dev
# Finally
sudo apt install ./gcc-6_6.4.0-17ubuntu1_amd64.deb
# GCC-6 is now installed, you can test by gcc-6 -v
baudneo@ZMES-test:~$ gcc-6 -v
gcc version 6.4.0 20180424 (Ubuntu 6.4.0-17ubuntu1)
# Now for G++ 6
sudo apt install ./libstdc++-6-dev_6.4.0-17ubuntu1_amd64.deb
sudo apt install ./g++-6_6.4.0-17ubuntu1_amd64.deb
# G++-6 is now installed! test by g++-6 -v
baudneo@ZMES-test:~$ g++-6 -v
gcc version 6.4.0 20180424 (Ubuntu 6.4.0-17ubuntu1)
# Now it is time to configure the system to use GCC G++ 6
# This assumes you do not have other versions of gcc and g++ installed for other projects
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100
sudo update-alternatives --set c++ /usr/bin/g++
# When you want to revert these back to default gcc-10
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
sudo update-alternatives --set c++ /usr/bin/g++https://askubuntu.com/questions/1370373
复制相似问题