To install GCC on a network, you only need one command: Yum install GCC. How can you install GCC without a network? Although there is no network, I think you should have a CD or ISO image. If there is no such image, then.
If you have these, we only need to use the installation CD or ISO image to mount a local Yum source and use this to install GCC.
I. Mount the yum source. I use an ISO image to input the command "Mount-o loop XXXX. ISO/Media/centos/" on the terminal/
Note: XXXX. ISO is your image file name (correct path)
/Media/centos/This is the address of the mounted file. centos is built by yourself. You can also select the path by yourself;
2: Modify/etc/yum. Repos. d/CentOS-Media.repo
1. First enter the file: VI/etc/yum. Repos. d/CentOS-Media.repo
2. Modify the file as follows:
C6-media
Name = centos-$ releasever-media # Name
Baseurl = file: // media/centos # remember the address of the image you just mounted.
Gpgcheck = 1
Enabled = 1
Gpgkey = file: // etc/Media/centos/RPM-GPG-KEY-CentOS-6 # still pay attention to the path
3. Exit and save.
4. Enter the command gcc-V to check whether the response is correct.
How to install GCC without a network