Skip to content

CHIT

  • About
  • Tutorials
  • Tech Support And IT Services
    • Assistenza, supporto e riparazioni PC/Laptop Windows/Linux (Locarno, Ticino)
  • Contact

How To Use Old Versions of GCC on openSUSE Leap 16.1

Posted on 1 December 20261 December 2026 By Ch IT No Comments on How To Use Old Versions of GCC on openSUSE Leap 16.1

How To Use Multiple Versions of GCC on openSUSE Leap 16.1

To install old versions of gcc you can download the RPM packets from old repositories and install them.

For example, if you want to install the gcc-7 version of GCC, you search for the packets and their dependencies in the oss repository of openSUSE 15.

You can download the files and install the RPM packets.

:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/libisl15-0.18-lp150.1.49.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/libtsan0-7.3.1+r258812-lp150.2.10.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/cpp7-7.3.1+r258812-lp150.2.10.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/gcc7-7.3.1+r258812-lp150.2.10.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/libasan4-7.3.1+r258812-lp150.2.10.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/libmpx2-7.3.1+r258812-lp150.2.10.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/libubsan0-7.3.1+r258812-lp150.2.10.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/libcilkrts5-7.3.1+r258812-lp150.2.10.x86_64.rpm
:~> wget https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/libmpxwrappers2-7.3.1+r258812-lp150.2.10.x86_64.rpm
# rpm -i libtsan0-7.3.1+r258812-lp150.2.10.x86_64.rpm
# rpm -i libisl15-0.18-lp150.1.49.x86_64.rpm
# rpm -i cpp7-7.3.1+r258812-lp150.2.10.x86_64.rpm
# rpm -i libubsan0-7.3.1+r258812-lp150.2.10.x86_64.rpm
# rpm -i libmpx2-7.3.1+r258812-lp150.2.10.x86_64.rpm
# rpm -i libasan4-7.3.1+r258812-lp150.2.10.x86_64.rpm
# rpm -i gcc7-7.3.1+r258812-lp150.2.10.x86_64.rpm

Update-alternatives – How To Use Multiple Versions Of GCC

Now, to be able to use multiple versions of GCC on Linux you have to use update-alternatives.

:~> which gcc-7
/bin/gcc-7
:~> 
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 20
# update-alternatives --install /usr/bin/gcc gcc /bin/gcc-7 40
# update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 60
# update-alternatives --set cc /usr/bin/gcc
# update-alternatives --config gcc

The version you want in auto mode is the one with the highest number and it will be used automatically. To check the version in use you can run the following command:

:~> gcc --version

Update-alternatives - How to use old versions of GCC

openSUSE, Tutorials Tags:gcc-10, gcc-7, gcc-9, ggc-8, linux, old, openSUSE Leap 16.1, update-alternatives, versions

Post navigation

Previous Post: Host Device GPU Pass-Through On KVM/QEMU/Libvirt

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • How To Use Old Versions of GCC on openSUSE Leap 16.1
  • Host Device GPU Pass-Through On KVM/QEMU/Libvirt
  • How to Create Customized LLMs (AI Assistants) Using Ollama
  • Virt-install and virsh: Creating and Managing Virtual Machines
  • How to Create Virtual Machines on QEMU/KVM Using Virt-Manager
English
Italian