9

Is there any way 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 '18 at 14:23
  • 3
    @KnudLarsen That is very irrelevant. – Jon Deaton Jul 5 '18 at 23:56
11

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

| improve this answer | |
0

in the server mode the default install don't add the universe repository in the sourcelist and only gcc8 and gcc7 is avaible in main. Add the universe repository, update the repo and install gcc4.8

| improve this answer | |

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.