[Reserved] Linux (centOS 7) off-line system installed gcc and its dependencies

When installing Redis, need to use gcc. If the system is networked, so direct use the following command to install networking.

yum -y install gcc

But if the system is not networked, then you need a way to install the offline. Proceed as follows:

1. Remove the system from the desired rpm package installed in the image CentOS7 (can also be obtained by other ways): extract the image file into the "Packages" directory, there are many packages rpm, taken following several:

Copy the code
mpfr-3.1.1-4.el7.x86_64.rpm
libmpc-1.0.1-3.el7.x86_64.rpm
kernel-headers-3.10.0-123.el7.x86_64.rpm
glibc-headers-2.17-55.el7.x86_64.rpm
glibc-devel-2.17-55.el7.x86_64.rpm
cpp-4.8.2-16.el7.x86_64.rpm
gcc-4.8.2-16.el7.x86_64.rpm
Copy the code

2. These packets uploaded to the system to be installed, the installation commands in the following order:

Copy the code
rpm -ivh mpfr-3.1.1-4.el7.x86_64.rpm
rpm -ivh libmpc-1.0.1-3.el7.x86_64.rpm
rpm -ivh kernel-headers-3.10.0-123.el7.x86_64.rpm
rpm -ivh glibc-headers-2.17-55.el7.x86_64.rpm
rpm -ivh glibc-devel-2.17-55.el7.x86_64.rpm
rpm -ivh cpp-4.8.2-16.el7.x86_64.rpm
rpm -ivh gcc-4.8.2-16.el7.x86_64.rpm
Copy the code

You can also use the following command unified installation:

rpm -Uvh *.rpm --nodeps --force

3. After successfully installed, verify

gcc -v

Guess you like

Origin www.cnblogs.com/sancn/p/12119682.html