How to Install GCC Compiler on CentOS 7

Install GCC Compiler on CentOS 7

In this article, we will have explained the necessary steps to install and configure GCC Compiler on CentOS 7. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

GCC or GNU Compiler Collection is released by the Free Software Foundation and as the name suggests, it is a very useful collection of programming compilers such as C, C++, Objective-C, Objective-C++, Fortran, Java, Go, and Ada. Many open-source projects including the GNU tools and the Linux kernel are compiled with GCC.

Install GCC Compiler on CentOS 7

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo yum install epel-release
sudo yum update

Step 2. Install GCC Compiler on CentOS system.

To install gcc compiler and development tools by issue the following command:

sudo yum group install "Development Tools"

If you want to check if gcc is installed successfully, just issue the following command:

# gcc --version
gcc (GCC) 4.8.5 20150463 (Red Hat 4.8.5-36)
Copyright (C) 2015 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 PA

That’s all you need to do to install GCC on CentOS 7. I hope you find this quick tip helpful. For further reading on GCC Compiler, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.