centos 7.2 离线安装 gcc
1、查看有没有挂载 centos 7.2 的镜像源文件
2、如果没有就通过服务端挂载
如果不知怎么挂载,就解压CentOS-7-x86_64-DVD-1511.iso 镜像文件,在Packages找到 所需要的rpm包,上传安装
3、运行命令
cd /run/media/root/CentOS\ 7\ x86_64/Packages/ -- 进入Packages
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-327.el7.x86_64.rpm
rpm -ivh glibc-headers-2.17-105.el7.x86_64.rpm
rpm -ivh glibc-devel-2.17-105.el7.x86_64.rpm
rpm -ivh cpp-4.8.5-4.el7.x86_64.rpm
rpm -ivh gcc-4.8.5-4.el7.x86_64.rpm
gcc -v -- 查看版本