0

How can I install the old version of gcc (gcc-4.1.2) on Ubuntu? ( without Synaptic ) .My actual version of gcc is gcc-4.4.7

  • 1
    The default compilers , Ubuntu 16.04 are : 1) The system compiler g++ = version 5.3.1 , 2) g++-4.7 , 3) g++-4.8 , 4) g++-4.9 . ..... ? What is the purpose of gcc-4.1.2 ? ? – Knud Larsen May 28 '16 at 19:15
  • I am trying to compile some old program that is using ver 4.1.2 of gcc and is incompatible with the newest versions – Veronika May 28 '16 at 19:43

2 Answers2

2

Assume a 64bits Ubuntu 16.04 .

Available is {gcc-3.4.6, g++-3.4.6} ... This version is very close to gcc-4.1.2 .

gcc34 https://drive.google.com/file/d/0B7S255p3kFXNRTkzQnRSNXZ6UVU/view?usp=sharing

g++34 https://drive.google.com/file/d/0B7S255p3kFXNV3J3bnVoWGNWdG8/view?usp=sharing

Clik the packages, compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb and compat-gcc-34-c++_3.4.6-20_amd64.deb : They will then be installed.

Using, examples : 1) $ export CC=gcc34 CXX=g++34 && [other command] ... like 2) $ export CC=gcc34 CXX=g++34 && ./configure .... and 3) $ gcc34 file.c

? Which application is it that requires gcc-4.1.2 ?


Knud Larsen
  • 3,084
  • On Docker and Ubuntu16.04 I end up with a configure: error: C compiler cannot create executables after installing the .deb packages via dpkg -i. – loretoparisi Nov 27 '17 at 16:37
  • @loretoparisi : Please specify your "Ubuntu16.04" : Is it a 32bits OS, or is it 64bits ? – Knud Larsen Nov 30 '17 at 22:27
0

Possible dupe of this question: How to install specific Ubuntu packages, with exact version?

First, find the exact name of the version of gcc you wish to install by running:

sudo apt-cache madison ^gcc

Then find the version you want and run:

sudo apt-get install gcc=VERSION

Finally, run this command to check which version of gcc you installed:

dpkg -l 'gcc*' | grep ^i

Note: This may cause some dependency issues.

carreter
  • 138