1

I am running an Ubuntu 14.04-4 64bit. gcc --version returns

(Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4

Yet, I need version 4.8.2-10. What I tried:

  1. I found the specific gcc version in a debian snapshot repository.
  2. I adapted my /etc/apt/sources.list to contain the following two lines only:

    deb http://snapshot.debian.org/archive/debian/20131213T160912Z unstable main    
    deb-src http://snapshot.debian.org/archive/debian/20131213T160912Z unstable main
    
  3. As suggested here I added the required key

  4. I did sudo apt-get -o Acquire::Check-Valid-Until=false update
  5. sudo apt-get remove gcc
  6. sudo apt-get install gcc. This returned:

     ...
     Preparing to unpack .../gcc_4%3a4.8.2-1_amd64.deb ...
     Unpacking gcc (4:4.8.2-1) ...
     Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
     Setting up gcc (4:4.8.2-1) ...
    

Unfortunately, gcc --version still returned gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4

Removing and re-installing gcc-4.8 and gcc-4.8-base returned in an error (unmet dependencies) or a strange warning (uninstalling more than 700mb).

How can I install this specific gcc version?

2 Answers2

0

You can find the packages you want over here and install them using gdebi.

Stormlord
  • 6,317
-1

You can have as many versions of gcc as you want, installed at the same time : The default versions for Ubuntu 14.04 are → →

$ sudo apt-get install g++-4.4 g++-4.6 g++-4.7 g++-4.8

... where "4.8" = version 4.8.2 is the system compiler, /usr/bin/{ gcc, g++ }

Using one of the other compilers, examples : $ gcc-4.4 file.c ,,, $ export CC=gcc-4.4 CXX=g++-4.4 && [other command] ,,, like $ export CC=gcc-4.4 CXX=g++-4.4 && ./configure


Knud Larsen
  • 3,084
  • I don't see how this answers my question. How can I install the exact version I mentioned in my question? – langlauf.io May 19 '16 at 19:12
  • Not a good idea to replace the system compiler. But you can of course compile the older version 4.8.2, by building with configure option --program-suffix=482 http://www.linuxquestions.org/questions/linux-newbie-8/installing-gcc-4-8-2-on-opensuse-12-1-a-4175484799/#4 – Knud Larsen May 19 '16 at 19:22
  • ? Why do you want "4.8.2-10" . Seems that the original "April 2014 packages" were : cpp-4.8_4.8.2-19ubuntu1_amd64.deb, gcc-4.8-base_4.8.2-19ubuntu1_amd64.deb, gcc-4.8_4.8.2-19ubuntu1_amd64.deb, g++-4.8_4.8.2-19ubuntu1_amd64.deb → → https://mirror.umd.edu/ubuntu/pool/main/g/gcc-4.8/ – Knud Larsen May 20 '16 at 18:17
  • 1
    I downloaded the package and did an dpkg -i gcc-4.8_4.8.2-19ubuntu1_amd64.deb. I got a "dependency problem" error. It says that gcc-4.8 depends on cpp-4.8 (= 4.8.2-19ubuntu1); however: Version of cpp-4.8 on system is 4.8.4-2ubuntu1~14.04.3 – langlauf.io May 20 '16 at 18:27
  • Please also see https://mirror.umd.edu/ubuntu/pool/main/g/gcc-defaults/ - – Knud Larsen May 20 '16 at 18:28
  • if I try to install cpp it says: cpp-4.8 depends on gcc-4.8-base (= 4.8.2-19ubuntu1); however: Version of gcc-4.8-base:amd64 on system is 4.8.4-2ubuntu1~14.04.3. – langlauf.io May 20 '16 at 18:29
  • Sorry, I don't understand what to do with the link. – langlauf.io May 20 '16 at 18:30
  • To install new packages, please first remove { gcc-4.8-base, gcc, g++, libstdc++-4.8-dev }. The issues will probably be : libgcc1, libstdc++ , which you cannot remove or downgrade, I think. – Knud Larsen May 20 '16 at 18:34
  • I got it installed. I needed the right order: gcc-4.8-base_4.8.2-19ubuntu1_amd64.deb cpp-4.8_4.8.2-19ubuntu1_amd64.deb libgcc-4.8-dev_4.8.2-19ubuntu1_amd64.deb gcc-4.8_4.8.2-19ubuntu1_amd64.deb – langlauf.io May 20 '16 at 18:36