在 ubuntu 18.04 安装 gcc 4.9

Nik*_*kis 9 gcc 18.04

有没有办法在 ubuntu 18.04 上安装 gcc 4.9?我试过

sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
Run Code Online (Sandbox Code Playgroud)

但我得到:

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
Run Code Online (Sandbox Code Playgroud)

我需要这个版本来用狙击手运行一些模拟。有没有办法做到这一点,或者我必须用 ubuntu 16.04 制作一个虚拟机?

Knu*_*sen 13

可用的是: sudo apt install g++-4.8

没有PIE gcc54-c++_5.4.0-ubuntu16_amd64.deb https://drive.google.com/file/d/1ptHLaZXImpeMzq4xuuGGn5VjrvxNSop3/view?usp=sharing参考文献。 /sf/ask/3514916261/#50232797 ? 我的答案。

或添加xenial/etc/apt/sources.list暂时:sudo gedit /etc/apt/sources.list

deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
Run Code Online (Sandbox Code Playgroud)

...然后做 sudo apt update && sudo apt install g++-4.9

  • 不要在随机云上发布指向随机二进制文件的链接! (2认同)