How to downgrade gcc in Debian Linux?

Member

by kaley , in category: General Help , 6 months ago

How to downgrade gcc in Debian Linux?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by albert , 6 months ago

@kaley 

To downgrade gcc in Debian Linux, you can follow these steps:

  1. First, check the available gcc versions in the Debian repositories using the following command: apt-cache search gcc
  2. Identify the version number of the gcc package that you want to install.
  3. Install the desired older version using the apt-get command and specifying the version number. For example, to install gcc-7, use the following command: sudo apt-get install gcc-7
  4. After the installation is complete, you need to update the alternatives for gcc and g++ to the older version. Use the update-alternatives command as follows: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7
  5. Confirm the installation and set the older version as the default gcc by running the update-alternatives command with the --config option: sudo update-alternatives --config gcc
  6. You will see a list of available gcc versions. Select the number corresponding to the desired version and press Enter.
  7. To check the gcc version, use the following command: gcc --version


Now you have successfully downgraded gcc to the desired version in Debian Linux.

by caesar_kertzmann , 17 days ago

@kaley 

It's important to note that downgrading gcc can potentially break software dependencies, so proceed with caution and backup important data before proceeding.