How to install the GCC compiler in CentOS 7?
Publisher: Psychz Networks, March 17,2019GCC (short for GNU Compiler Collection), is a collection of programming compilers including C, C++, Objective-C, Fortran, Java, and Ada. GCC is a key component of the GNU toolchain and the standard compiler for most Unix-like operating systems. The Free Software Foundation distributes GCC under the GNU General Public License.
In the following tutorial, we will perform GCC installation on CentOS 7. The installation process is quite simple and should not take more than 10 minutes.
Step 1: Perform an update on the server
Note: You need to log in to your CentOS 7 VPS via SSH as user root
#ssh root@IP_Address -p Port_number
To update all installed packages on the server you can use the following command
#yum -y update
Step 2: Install GCC from the repository
GCC can be easily installed from the official CentOS repositories. Run the following command to install GCC on your server
#yum -y install
gcc
Output:
Running transaction test
Transaction test succeeded
Running transaction
Installing : cpp-4.8.5-36.el7.x86_64 1/5
Installing : kernel-headers-3.10.0-957.5.1.el7.x86_64 2/5
Installing : glibc-headers-2.17-260.el7_6.3.x86_64 3/5
Installing : glibc-devel-2.17-260.el7_6.3.x86_64 4/5
Installing : gcc-4.8.5-36.el7.x86_64 5/5
Verifying : glibc-devel-2.17-260.el7_6.3.x86_64 1/5
Verifying : gcc-4.8.5-36.el7.x86_64 2/5
Verifying : kernel-headers-3.10.0-957.5.1.el7.x86_64 3/5
Verifying : cpp-4.8.5-36.el7.x86_64 4/5
Verifying : glibc-headers-2.17-260.el7_6.3.x86_64 5/5
Installed:
gcc.x86_64 0:4.8.5-36.el7
Dependency Installed:
cpp.x86_64 0:4.8.5-36.el7 glibc-devel.x86_64 0:2.17-260.el7_6.3 glibc-headers.x86_64 0:2.17-260.el7_6.3 kernel-headers.x86_64 0:3.10.0-957.5.1.el7
Complete!
Step 3: Verify GCC installation on CentOS 7
After the compilation process is completed. You can check if GCC is properly installed.
#
gcc
--version
Output:
gcc
(GCC) 4.8.5 20150623 (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 PARTICULAR PURPOSE.
Thank you for referring to this article. If you find this article helpful, please give us a vote.