redhat6.4如何重新安装yum(笔记)

版权声明:本文为博主[email protected](阿King)原创文章,不得以任何理由任何形式进行转载 https://blog.csdn.net/lj501886285/article/details/54755795

1.卸载redhat自带的yum
rpm -qa|grep yum|xargs rpm -e –nodeps

2.导入yum所需的key
cd /etc/pki/rpm-gpg/
wget http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6 此处最后的6可换成5或7或任意发型版本
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*

3.下载yum所需的包
查看网站http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/
寻找包yum、yum-plugin-fastestmirror、yum-metadata-parser、python-urlgrabber,通过wget下载

4.卸载redhat自带的python-urlgrabber包(版本太低)
rpm -qa|grep python-urlgrabber|xargs rpm -e –nodeps

5.安装下载的yum及其相关包
rpm -ivh python-urlgrabber yum-plugin-fastestmirror yum-metadata-parser yum

6.编写yum源文件
vi /etc/yum.repos.d/rhel-debuginfo.repo
[base]
name=Red Hat Enterprise Linux $releasever -Base
baseurl=http://mirrors.sohu.com/centos/6/os/$basearch/
gpgcheck=1

[update]
name=Red Hat Enterprise Linux $releasever -Updates
baseurl=http://mirrors.sohu.com/centos/6/updates/$basearch/
gpgcheck=1

[extras]
name=Red Hat Enterprise Linux $releasever -Extras
baseurl=http://mirrors.sohu.com/centos/6/extras/$basearch/
gpgcheck=1
其中的“6”应与步骤2中key的版本相对应

7.可开始使用yum

猜你喜欢

转载自blog.csdn.net/lj501886285/article/details/54755795