Installing GCC with Yum
Installing with the Yum command is also very easy.
yum -y install gcc gcc-c++ kernel-devel //安装gcc、c++编译器以及内核文件
Installing GCC manually
- Remove the required RPM package from the CENTOS7 system installation image (also available in other ways): Unzip the image file, enter the "Packages" directory, many RPM packages, take out the following several:
Mpfr-3.1.1-4.el7.x86_64.Rpmlibmpc-1.0.1-3.el7.x86_64.Rpmkernel-Headers-3.10.0-123.el7.x86_64.rpmglibc-headers-2.17-55. El7.x86_64.-devel-2.17- 55.el7.x86_64.-4.8. 2-16.el7.x86_64. Rpmgcc-4.8. 2-16.el7.x86_64. RPM
2. Upload these packages to the system you want to install "installable xftp for upload" and execute the installation commands in the following order:
Rpm-IVH MPFR-3.1.1-4.el7.x86_64.rpmrpm-IVH LIBMPC-1.0.1-3.el7.x86_64.rpmrpm-IVH kernel-Headers-3.10.0-123.el7.x86_64.rpmrpm-IVH glibc-Headers-2.17-55.el7.x86_64rpmrpm -ivh glibc--2.17-55.el7.x86 _64.-ivh cpp-4.8.< Span class= "lit" >2-16.el7.x86_64.rpmrpm -ivh gcc-4.8 2-16.el7.x86_64.< Span class= "PLN" >rpm
You can also install it uniformly using the following command:
rpm -Uvh *.rpm --nodeps --force
- After the installation is successful, verify that
gcc -v
LINUX--CENTOS7 Installing the GCC compiler detailed