How can I downgrade GCC to version 6 on 20.04?
10,964
Ubuntu 20.04, gcc-6
Please do not remove / change the system gcc : You can have as many gcc versions as you want, installed at the same time. Add (temporarily) a line to /etc/apt/sources.list :
apt [url] bionic main universe
, and do
sudo apt update
sudo apt install g++-6
My test : {gcc-6, g++-6} was installed OK.
Using extra compilers, examples : export CC=gcc-6 CXX=g++-6 && ./configure
and make CC=gcc-6 CXX=g++-6
Other (non PIE) extra compilers for Ubuntu https://drive.google.com/drive/folders/1xVEATaYAwqvseBzYxKDzJoZ4-Hc_XOJm?usp=sharing
Related videos on Youtube
Author by
nnpractice
Updated on September 18, 2022Comments
-
nnpractice almost 2 years
How can I downgrade GCC to version 6 on 20.04?
I need GCC6 to compile CUDA9 files.
Trying
apt install gcc-6
is giving me this error:Package gcc-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 'gcc-6' has no installation candidate
-
nnpractice about 4 yearsin your answer you didn't mention the link you wrote to add to the sources file.
-
nnpractice about 4 yearsI meant this URL:
deb http://dk.archive.ubuntu.com/ubuntu/ bionic main universe
-
Knud Larsen about 4 yearsThe local mirror is my example. You can use any other valid mirror / URL.
-
nnpractice about 4 yearsBut you should mentioned because when I used
deb http://archive.ubuntu.com/ubuntu
I got errors. I was able later when you mentioned that because gcc-6 and g++-6 was available on your local server. Those are not available on global mirrors for bionic. -
Knud Larsen about 4 yearsgcc-6, g++-6 etc. seems to be present at archive.ubuntu.com/ubuntu → universe/g/gcc-6 → archive.ubuntu.com/ubuntu/pool/universe/g/gcc-6 .... so quite puzzling why you cannot fetch it.
-
nnpractice about 4 yearsI literally told you I added
deb http://archive.ubuntu.com/ubuntu
to sources file and updated and tried to install and got the error I showed you in my question.