How to install GCC 5.4 on ubuntu 17.10 (Downgrade)?

14,098

You can go to the packages.ubuntu.com page for gcc-5 and you will see that eg xenial still has it: https://packages.ubuntu.com/xenial/gcc-5

Now it may just be a matter of adding the xenial repo info back into /etc/sources.list (or maybe /etc/sources.list.d/xenial.conf to easily uncomment later), run apt-get update and apt-get install gcc-5.

Another alternative is to use Docker and just run in a xenial container...

Share:
14,098
jonb
Author by

jonb

Updated on June 28, 2022

Comments

  • jonb
    jonb almost 2 years

    I have ubuntu 17.10. gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2)

    I have to get GCC 5.4. I've tried:

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

    But i'm receiving :

    E: Unable to locate package gcc-5.4
    E: Couldn't find any package by glob 'gcc-5.4'
    E: Couldn't find any package by regex 'gcc-5.4'
    

    At apt-get install gcc I receive gcc is already the newest version (4:7.2.0-1ubuntu1).

    I have to downgrade to 5.4,

    How can I solve it? Thanks

  • Adi Shavit
    Adi Shavit almost 6 years
    what do I do with these lists? Could you elaborate?