Hello, friends. For many people installing the latest version of GCC can be quite important for daily work. So in this post, you will learn how to do it so that it can also help you with your tasks.
If you didn’t know, GCC is the compiler for the C language provided by the GNU project. With GCC we can use the C language on our computer but also with it we can create or run other applications like libraries.
The mythical GCC is one of the basic tools for compiling and building packages. Present in almost every Linux distribution out there, it is the basis for many processes in building a distribution.
Some people need for whatever reason to have the latest stable version of GCC. That is why we have prepared this post as simple as possible so that anyone can do it.
Of all the ways we have to achieve this goal, maybe Homebrew is the one that makes it the easiest. So let’s take advantage of this extraordinary tool to achieve our goal.
The first step then is to install Homebrew on Ubuntu 20.04 / Debian 10 after that we can continue without any problems.
The next step is to simply run the
brew command to install GCC, the latest version of which is 11.1.
brew install gcc
Then the whole download and installation process will start. If everything went well, you will see the following output on the screen.
To check that GCC is installed, you can display the version.
In case you already have GCC installed globally, then you can go to the folder where the binary is and run
cd /home/linuxbrew/.linuxbrew/Cellar/gcc/11.1.0_1/bin ./gcc-11 --version
gcc-11 (Homebrew GCC 11.1.0_1) 11.1.0 Copyright (C) 2021 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.
So, enjoy it.
GCC is so common that sometimes we overlook it, but it is always good to have the latest stable version that can get us out of trouble at any time.