I am trying to compile Cuda 10.2 and predictably gcc-10 will not work to compile it. When using 20.04 it was simple, add bionic repo, update, install, update-alternatives. Using 21.04 I cannot get anything to work.
I tried with both xenial and bionic 'main' and 'universe' repos, which throws an error about the PUBKEY. I got the PUBKEYs from the ubuntu keyserver and update the package list, no errors.
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 candidate
sources.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
Does anyone know how I can achieve this using Ubuntu 21.04? Every post I have read says to add the bionic or xenial repos, update, install. I have had no luck so far.