Quick Answer: How do I install an older version of GCC Ubuntu?

How do I install an older version of gcc?

Check your current version by running gcc -v . Next, You want to install a previous version. Then after doing sudo apt-get update the new repositories will be available. Next, install the required compiler.

How do I downgrade gcc version?

2 Answers

  1. Uninstall gcc5.4. sudo apt-get remove gcc g++ Check gcc again: gcc –version.
  2. Install gcc 4.9/g++ 4.9. sudo apt-get install gcc-4.9 g++-4.9. Checking Version: g++-4.9 –version.
  3. Link to gcc g++ ln -s /usr/bin/g++-4.9 /usr/bin/g++ ln -s /usr/bin/gcc-4.9 /usr/bin/gcc.
  4. Checking Version: g++ –v gcc –v.

How do I change gcc version in Ubuntu?

Type update-alternatives –config gcc to be asked to choose the gcc version you want to use among those installed. (Note the use of cpp-bin instead of just cpp . Ubuntu already has a cpp alternative with a master link of /lib/cpp . Renaming that link would remove the /lib/cpp link, which could break scripts.)

How do I install gcc version?

Installing GCC on Ubuntu

  1. Start by updating the packages list: sudo apt update.
  2. Install the build-essential package by typing: sudo apt install build-essential. …
  3. To validate that the GCC compiler is successfully installed, use the gcc –version command which prints the GCC version: gcc –version.

How do I use old GCC?

2 Answers

  1. Update the available package information and install GCC 6.3. sudo apt update sudo apt install gcc-6.
  2. Add GCC 6 as an alternative for GCC. …
  3. Once you’re done with “making”, you can remove the installed GCC 6.3 and the repository information of Zesty. …
  4. Fix the symlink for /usr/bin/gcc .

How do I get GCC?

How to Download & Install GCC Compiler for C in Windows PC

  1. Step 1) Download Binary release. …
  2. Step 2) Select the installer with GCC for Windows compiler. …
  3. Step 3) Start installation. …
  4. Step 4) Accept the terms and conditions. …
  5. Step 5) Keep default component selection. …
  6. Step 6) Locate the installation path.

How do I get rid of GCC?

purge Use purge instead of remove for anything that would be removed. An asterisk (“*”) will be displayed next to packages which are scheduled to be purged. remove –purge is equivalent to the purge command. Configuration Item: APT::Get::Purge.

What is Update alternatives in Ubuntu?

update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system. It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time.

How do I set gcc version?

You can specify the version number by sending the full path: greg@greg-mint ~ $ gcc –version gcc (Ubuntu/Linaro 4.7.

How do I check my gcc version?

Type “gcc –version” in command prompt to check whether C compiler is installed in your machine. Type “g++ –version” in command prompt to check whether C++ compiler is installed in your machine.

How do I use different gcc versions?

Direct link to this answer

  1. Open the terminal window in LINUX and execute the command:
  2. $ which gcc.
  3. This will provide the symbolic link (softlink) to the default version of GCC.
  4. Navigate to the directory which has this softlink.
  5. Change the softlink to point to the version of GCC that you want to use.
Like this post? Please share to your friends:
OS Today