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?

0

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

-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


  • I don't see how this answers my question. How can I install the exact version I mentioned in my question? – stackoverflowwww 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 linuxquestions.org/questions/linux-newbie-8/… – 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 → → 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 – stackoverflowwww May 20 '16 at 18:27
  • Please also see mirror.umd.edu/ubuntu/pool/main/g/gcc-defaults - – Knud Larsen May 20 '16 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.