How to install multiple version of GCC (GCC-3.3) on Ubuntu 16?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with



sudo apt-get install gcc-3.3


it's not installing.



~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.


When I tried to list all the available versions of gcc,



 sudo apt-cache search gcc


it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?



My current gcc version is:



~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.









share|improve this question























  • gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
    – Faheem Mitha
    Jun 29 '17 at 10:17











  • I got debian repository and added it to /etc/apt/sources.list. It works for me
    – Kaushali de silva
    Jun 30 '17 at 3:44















up vote
1
down vote

favorite












I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with



sudo apt-get install gcc-3.3


it's not installing.



~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.


When I tried to list all the available versions of gcc,



 sudo apt-cache search gcc


it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?



My current gcc version is:



~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.









share|improve this question























  • gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
    – Faheem Mitha
    Jun 29 '17 at 10:17











  • I got debian repository and added it to /etc/apt/sources.list. It works for me
    – Kaushali de silva
    Jun 30 '17 at 3:44













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with



sudo apt-get install gcc-3.3


it's not installing.



~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.


When I tried to list all the available versions of gcc,



 sudo apt-cache search gcc


it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?



My current gcc version is:



~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.









share|improve this question















I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with



sudo apt-get install gcc-3.3


it's not installing.



~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.


When I tried to list all the available versions of gcc,



 sudo apt-cache search gcc


it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?



My current gcc version is:



~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.






ubuntu software-installation gcc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 29 '17 at 10:54









GAD3R

22.9k164895




22.9k164895










asked Jun 29 '17 at 8:54









Kaushali de silva

62




62











  • gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
    – Faheem Mitha
    Jun 29 '17 at 10:17











  • I got debian repository and added it to /etc/apt/sources.list. It works for me
    – Kaushali de silva
    Jun 30 '17 at 3:44

















  • gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
    – Faheem Mitha
    Jun 29 '17 at 10:17











  • I got debian repository and added it to /etc/apt/sources.list. It works for me
    – Kaushali de silva
    Jun 30 '17 at 3:44
















gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
– Faheem Mitha
Jun 29 '17 at 10:17





gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
– Faheem Mitha
Jun 29 '17 at 10:17













I got debian repository and added it to /etc/apt/sources.list. It works for me
– Kaushali de silva
Jun 30 '17 at 3:44





I got debian repository and added it to /etc/apt/sources.list. It works for me
– Kaushali de silva
Jun 30 '17 at 3:44











4 Answers
4






active

oldest

votes

















up vote
0
down vote













You can download the debian package from here



http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb



and install with



sudo dpkg -i /path/to/package





share|improve this answer




















  • There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
    – Kaushali de silva
    Jun 29 '17 at 9:34











  • This link will download the .deb file. Use the path to the .deb package. Don't extract it.
    – newage_newton
    Jun 29 '17 at 9:45

















up vote
0
down vote













It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.



If you need further elaboration, please comment.






share|improve this answer



























    up vote
    0
    down vote













    I've added Debian repository to /etc/apt/source.



     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


    Then I searched gcc by using



    sudo apt-cache search gcc


    Then it listed gcc-3.3
    then I installed



    sudo apt-get install gcc-3.3 g++-3.3


    Then I've changed the symbolic link of gcc to select gcc 3.3






    share|improve this answer




















    • Are you able to switch between gcc-3 and gcc-5?
      – GAD3R
      Jun 30 '17 at 12:37

















    up vote
    0
    down vote













    download, compile, and install GCC from source



    i typically get the tar.gz one;
    you can get the source from one of the mirror sites listed from gcc.gnu.org
    https://gcc.gnu.org/mirrors.html



    tar -xf gcc-3.3.6.tar.gz
    ./configure --prefix=/usr/local/gcc-3.3.6
    make
    make install


    adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin



    you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.



    when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this



    *for bash*
    export PATH=/usr/local/gcc-3.3.6/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH

    *for csh or tcsh*
    setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
    setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH


    either open a new terminal window or first type rehash



    then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.



    whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.



    during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help



    • this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using --prefix=

    • adjust LD_LIBRARY_PATH, and PATH, accordingly to use whichever





    share|improve this answer






















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f374118%2fhow-to-install-multiple-version-of-gcc-gcc-3-3-on-ubuntu-16%23new-answer', 'question_page');

      );

      Post as a guest






























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      You can download the debian package from here



      http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb



      and install with



      sudo dpkg -i /path/to/package





      share|improve this answer




















      • There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
        – Kaushali de silva
        Jun 29 '17 at 9:34











      • This link will download the .deb file. Use the path to the .deb package. Don't extract it.
        – newage_newton
        Jun 29 '17 at 9:45














      up vote
      0
      down vote













      You can download the debian package from here



      http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb



      and install with



      sudo dpkg -i /path/to/package





      share|improve this answer




















      • There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
        – Kaushali de silva
        Jun 29 '17 at 9:34











      • This link will download the .deb file. Use the path to the .deb package. Don't extract it.
        – newage_newton
        Jun 29 '17 at 9:45












      up vote
      0
      down vote










      up vote
      0
      down vote









      You can download the debian package from here



      http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb



      and install with



      sudo dpkg -i /path/to/package





      share|improve this answer












      You can download the debian package from here



      http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb



      and install with



      sudo dpkg -i /path/to/package






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jun 29 '17 at 9:16









      newage_newton

      11




      11











      • There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
        – Kaushali de silva
        Jun 29 '17 at 9:34











      • This link will download the .deb file. Use the path to the .deb package. Don't extract it.
        – newage_newton
        Jun 29 '17 at 9:45
















      • There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
        – Kaushali de silva
        Jun 29 '17 at 9:34











      • This link will download the .deb file. Use the path to the .deb package. Don't extract it.
        – newage_newton
        Jun 29 '17 at 9:45















      There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
      – Kaushali de silva
      Jun 29 '17 at 9:34





      There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
      – Kaushali de silva
      Jun 29 '17 at 9:34













      This link will download the .deb file. Use the path to the .deb package. Don't extract it.
      – newage_newton
      Jun 29 '17 at 9:45




      This link will download the .deb file. Use the path to the .deb package. Don't extract it.
      – newage_newton
      Jun 29 '17 at 9:45












      up vote
      0
      down vote













      It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.



      If you need further elaboration, please comment.






      share|improve this answer
























        up vote
        0
        down vote













        It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.



        If you need further elaboration, please comment.






        share|improve this answer






















          up vote
          0
          down vote










          up vote
          0
          down vote









          It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.



          If you need further elaboration, please comment.






          share|improve this answer












          It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.



          If you need further elaboration, please comment.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 29 '17 at 10:25









          Faheem Mitha

          22.2k1677134




          22.2k1677134




















              up vote
              0
              down vote













              I've added Debian repository to /etc/apt/source.



               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


              Then I searched gcc by using



              sudo apt-cache search gcc


              Then it listed gcc-3.3
              then I installed



              sudo apt-get install gcc-3.3 g++-3.3


              Then I've changed the symbolic link of gcc to select gcc 3.3






              share|improve this answer




















              • Are you able to switch between gcc-3 and gcc-5?
                – GAD3R
                Jun 30 '17 at 12:37














              up vote
              0
              down vote













              I've added Debian repository to /etc/apt/source.



               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


              Then I searched gcc by using



              sudo apt-cache search gcc


              Then it listed gcc-3.3
              then I installed



              sudo apt-get install gcc-3.3 g++-3.3


              Then I've changed the symbolic link of gcc to select gcc 3.3






              share|improve this answer




















              • Are you able to switch between gcc-3 and gcc-5?
                – GAD3R
                Jun 30 '17 at 12:37












              up vote
              0
              down vote










              up vote
              0
              down vote









              I've added Debian repository to /etc/apt/source.



               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


              Then I searched gcc by using



              sudo apt-cache search gcc


              Then it listed gcc-3.3
              then I installed



              sudo apt-get install gcc-3.3 g++-3.3


              Then I've changed the symbolic link of gcc to select gcc 3.3






              share|improve this answer












              I've added Debian repository to /etc/apt/source.



               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


              Then I searched gcc by using



              sudo apt-cache search gcc


              Then it listed gcc-3.3
              then I installed



              sudo apt-get install gcc-3.3 g++-3.3


              Then I've changed the symbolic link of gcc to select gcc 3.3







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jun 30 '17 at 3:54









              Kaushali de silva

              62




              62











              • Are you able to switch between gcc-3 and gcc-5?
                – GAD3R
                Jun 30 '17 at 12:37
















              • Are you able to switch between gcc-3 and gcc-5?
                – GAD3R
                Jun 30 '17 at 12:37















              Are you able to switch between gcc-3 and gcc-5?
              – GAD3R
              Jun 30 '17 at 12:37




              Are you able to switch between gcc-3 and gcc-5?
              – GAD3R
              Jun 30 '17 at 12:37










              up vote
              0
              down vote













              download, compile, and install GCC from source



              i typically get the tar.gz one;
              you can get the source from one of the mirror sites listed from gcc.gnu.org
              https://gcc.gnu.org/mirrors.html



              tar -xf gcc-3.3.6.tar.gz
              ./configure --prefix=/usr/local/gcc-3.3.6
              make
              make install


              adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin



              you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.



              when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this



              *for bash*
              export PATH=/usr/local/gcc-3.3.6/bin:$PATH
              export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH

              *for csh or tcsh*
              setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
              setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH


              either open a new terminal window or first type rehash



              then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.



              whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.



              during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help



              • this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using --prefix=

              • adjust LD_LIBRARY_PATH, and PATH, accordingly to use whichever





              share|improve this answer


























                up vote
                0
                down vote













                download, compile, and install GCC from source



                i typically get the tar.gz one;
                you can get the source from one of the mirror sites listed from gcc.gnu.org
                https://gcc.gnu.org/mirrors.html



                tar -xf gcc-3.3.6.tar.gz
                ./configure --prefix=/usr/local/gcc-3.3.6
                make
                make install


                adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin



                you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.



                when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this



                *for bash*
                export PATH=/usr/local/gcc-3.3.6/bin:$PATH
                export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH

                *for csh or tcsh*
                setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
                setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH


                either open a new terminal window or first type rehash



                then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.



                whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.



                during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help



                • this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using --prefix=

                • adjust LD_LIBRARY_PATH, and PATH, accordingly to use whichever





                share|improve this answer
























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  download, compile, and install GCC from source



                  i typically get the tar.gz one;
                  you can get the source from one of the mirror sites listed from gcc.gnu.org
                  https://gcc.gnu.org/mirrors.html



                  tar -xf gcc-3.3.6.tar.gz
                  ./configure --prefix=/usr/local/gcc-3.3.6
                  make
                  make install


                  adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin



                  you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.



                  when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this



                  *for bash*
                  export PATH=/usr/local/gcc-3.3.6/bin:$PATH
                  export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH

                  *for csh or tcsh*
                  setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
                  setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH


                  either open a new terminal window or first type rehash



                  then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.



                  whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.



                  during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help



                  • this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using --prefix=

                  • adjust LD_LIBRARY_PATH, and PATH, accordingly to use whichever





                  share|improve this answer














                  download, compile, and install GCC from source



                  i typically get the tar.gz one;
                  you can get the source from one of the mirror sites listed from gcc.gnu.org
                  https://gcc.gnu.org/mirrors.html



                  tar -xf gcc-3.3.6.tar.gz
                  ./configure --prefix=/usr/local/gcc-3.3.6
                  make
                  make install


                  adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin



                  you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.



                  when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this



                  *for bash*
                  export PATH=/usr/local/gcc-3.3.6/bin:$PATH
                  export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH

                  *for csh or tcsh*
                  setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
                  setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH


                  either open a new terminal window or first type rehash



                  then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.



                  whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.



                  during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help



                  • this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using --prefix=

                  • adjust LD_LIBRARY_PATH, and PATH, accordingly to use whichever






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 28 at 16:38

























                  answered Aug 28 at 15:36









                  ron

                  8131614




                  8131614



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f374118%2fhow-to-install-multiple-version-of-gcc-gcc-3-3-on-ubuntu-16%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      Peggy Mitchell

                      Palaiologos

                      The Forum (Inglewood, California)