有没有一个包含旧版本gcc的存储库,适用于最新的Ubuntu。我想要安装gcc3和gcc4并存,以供那些特别需要gcc3的程序使用。
/etc/apt/sources.list
中。deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
$ apt-get update
$ apt-get install g++-3.4
或者,您可以使用Elazar在他的回答中发布的Debian快照,也可以使用旧版本Ubuntu的Ubuntu软件包存储库:http://packages.ubuntu.com
按照Elazar已经描述的方式将它们添加到/etc/apt/sources.list
:
deb http://archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://archive.ubuntu.com/ubuntu/ hardy universe
你可以在Ubuntu 16.04上通过Toolchain test builds PPA添加gcc-4.4(或任何4.4到8之间的版本)。
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt install gcc-4.4
另外,如果你需要在RH6上模拟gcc-4.4,请使用以下命令构建目标程序:
make CC="gcc-4.4 -U_FORTIFY_SOURCE"
/etc/apt/sources.list
活泼,时髦,前卫,急躁,勇敢,强壮等
deb http://old-releases.ubuntu.com/ubuntu/ hardy universe
deb-src http://old-releases.ubuntu.com/ubuntu/ hardy universe
apt update
apt install gcc-3.4
gcc-3.3在所有当前稳定版本中都可用(在lucid中,它在lucid-backports中可用)
您可以使用以下命令查看上述列表:
源代码包列表:
rmadison gcc-3.3
rmadison gcc-3.3 -S
以下是如何在Bionic (18.04)上安装旧版GCC。
对于GCC 4.4和4.6:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty main'
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty universe'
sudo apt install gcc-4.4 gcc-4.6
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'
sudo apt install gcc-4.7 gcc-4.9
而且GCC 4.8已经可用:
sudo apt install gcc-4.8
sudo apt install gcc-opt
build-essential
。 - Phani