5

I was able to install gcc 10 but I need 10.2 not 10 and it keeps telling me gcc10.2 does not exist, well it does and I tried installing it by compiling and building it in the command line however that did not seem to install it or make my system recognize its existence in any way.

sudo apt-get install gcc-10 g++-10 works.

sudo apt-get install gcc-10.2 g++-10.2 does not

5
  • Install the compiled binary on your $PATH. Try echo $PATH to see which filesystem locations are appropriate. Somewhere in /usr/local is best for locally-compiled binaries. 10.2 has not been packaged yet by Debian, and the next release of Ubuntu (20.10) will use 10.1.
    – user535733
    Aug 1, 2020 at 3:17
  • I added it to my path in .bashrc @user535733
    – Aplleroar
    Aug 1, 2020 at 3:20
  • How do I install it to my path? @user535733
    – Aplleroar
    Aug 1, 2020 at 3:27
  • I went to /user/local and gcc10.2 is already there.
    – Aplleroar
    Aug 1, 2020 at 3:29
  • Trying to configure it as an alternative but when I do gcc --version becomes unrecognized command until I switch back to gcc 10.
    – Aplleroar
    Aug 1, 2020 at 4:44

2 Answers 2

9

Tested on Ubuntu 20.04:

sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt update
sudo apt install g++-10
2

I replaced the version used in this article with mine and installed to /usr/loacl/bin instead.

Then I needed to update the gcc alternatives as shown here. I replaced this version with mine. I used /usr/local/bin/gcc-10.2.0/bin/gcc-10.2 to use the executable instead of the folder. It's currently working for me.

1
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the links for reference. Aug 10, 2020 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.