1.配置网络yum源
1.删除redhat7.0系统自带的yum软件包;
rpm -qa|grep yum >oldyum.pkg 备份原信息 rpm -qa|grep yum|xargs rpm -e --nodeps 不检查依赖,直接删除rpm包
2.自行下载所需要的软件包。包名会更新,根据当前最新的下载。如有有依赖问题,下载依赖包进行安装。
阿里云网络源地址:centos-7-os-x86_64-Packages安装包下载_开源镜像站-阿里云
网易163网络源地址:欢迎访问网易开源镜像站 CentOS
网络源地址:http://centos.ustc.edu.cn/centos/
打开网页,ctrl+f 搜索相关yum包:http://mirrors.163.com/centos/7/os/x86_64/Packages/
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-langpacks-0.4.2-7.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-rhn-plugin-2.0.1-10.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-54.el7_8.noarch.rpm
3.根据依赖项安装;
rpm -ivh yum-*
4.下载repo配置文件。
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/centos/7/atomic/x86_64/repo/CentOS-Base.repo
将文件中所有的$releasever**更换为**7,否则无法使用。sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo
5下载KEY文件:
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
6.清理yum缓存。将服务器软件包信息缓存至本地,提高搜索安装效率
yum -y clean all && yum -y makecache