红帽7.2更换网络yum源

红帽7.2换网络YUM源 方法

卸载软件包

[root@localhost ~]# rpm -aq|grep yum|xargs rpm -e --nodeps 
[root@localhost ~]# rpm -aq|grep python-iniparse|xargs rpm -e --nodeps 
下载以下软件包
[root@localhost ~]# wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
[root@localhost ~]# wget http://mirrors.sohu.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
[root@localhost ~]# wget http://mirrors.sohu.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
[root@localhost ~]# wget ftp://rpmfind.net/linux/centos/7.3.1611/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm

安装软件包

[root@localhost ~]# rpm -ivh *
配置163网络yum源
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/7/extras//$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/7/centosplus//$basearch/
gpgcheck=1
enabled=0
OK,成功。

猜你喜欢

转载自blog.csdn.net/abel_dwh/article/details/78468770
今日推荐