Is there anyway to install gcc 4.9 at ubuntu 18.04? I tried

sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9

but i get Package g++-4.9 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 I need this version for running some simulations with sniper. Is there anyway to do it or i have to make a VM with ubuntu 16.04?

  • 1
    Please edit your question to explain why you need gcc version 4.9 – Knud Larsen May 14 at 14:23
  • @KnudLarsen That is very irrelevant. – Jon Deaton Jul 5 at 23:56
up vote 7 down vote accepted

Available is: sudo apt install g++-4.8

And the no PIE gcc54-c++_5.4.0-ubuntu16_amd64.deb https://drive.google.com/file/d/1ptHLaZXImpeMzq4xuuGGn5VjrvxNSop3/view?usp=sharing , Ref. https://stackoverflow.com/questions/50213089/linking-error-with-gcc-g-7-3-0-on-ubuntu-18-04/50232797#50232797 → My answer.

Or add xenial to /etc/apt/sources.list temporarily : sudo gedit /etc/apt/sources.list

deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe

... and do sudo apt update && sudo apt install g++-4.9

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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