11

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?

Jeff
  • 1,674
Nikos
  • 121

2 Answers2

17

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

Knud Larsen
  • 3,084
  • 1
    You are the best thanks a lot A thought that if 4.9 was not available the same would happen with 4.8. – Nikos May 14 '18 at 15:34
  • You can always use $ apt-cache search g++ g++-4.8 ... and also use the on-line "Search & overview" page https://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names – Knud Larsen May 14 '18 at 17:22
  • Can I find/download gnat-4.x on ubuntu 18.04 somewhere? – Zoltán Oct 02 '18 at 15:23
  • I guess you can use e.g. the 14.04 gnat-4.6 https://packages.ubuntu.com/trusty/gnat-4.6 ... or the 16.04 gnat-4.9 https://packages.ubuntu.com/xenial/gnat-4.9 ... if the dependencies can fit 18.04 . ... Ref. https://packages.ubuntu.com/search?keywords=gnat&searchon=names – Knud Larsen Oct 02 '18 at 20:41
  • 3
    Do not post links to random binaries on random cloud! – Johan Boulé Jul 10 '19 at 15:09
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