Is there a repository containing packages for old versions of gcc, for the latest Ubuntu. I want to install gcc3 alongside gcc 4, for programs that need gcc3 specifically.
Add them to the
/etc/apt/sources.list as Elazar already described:
deb http://archive.ubuntu.com/ubuntu/ hardy universe deb-src http://archive.ubuntu.com/ubuntu/ hardy universe
The Hardy Universe repository is the one that contains gcc-3.4.
You can use debian snapshots. Add the following lines to
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
And you're set!
This works for many other old packages, make sure you select the correct timestamp, look for the correct one at snapshots.debian website.
You can add gcc-4.4 (or any version between 4.4 and 8) on Ubuntu 16.04 via the (Toolchain test builds PPA)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt install gcc-4.4
As an aside, if you need to emulate gcc-4.4 on RH6, build your target program with
make CC="gcc-4.4 -U_FORTIFY_SOURCE"
gcc-3.3 is available in all current stable releases (In lucid, it is available in lucid-backports)
You can see the above list with the following commands:
Source package list:
Source and binary list:
rmadison gcc-3.3 -S
For GCC 3.4 the correct source url is as below, since the old ones are moved into old-releases.ubuntu.com. Thanks to @Ignitor for the main pointer
for breezy, dapper, edgy, feisty, gutsy, hardy etc
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
On Ubuntu 18.04, I did:
sudo apt install gcc-opt
to install gcc-3.3, gcc-3.4, and gcc-4.0