原文:http://blog.csdn.net/w1573007/article/details/66968944?utm_source=itdadao&utm_medium=referral
redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题,另外CentOS公司去年已经被Redhat 收购了,不说费话了,我们还是来操作吧!
1、首先查看redhat 7.3系统本身所安装的那些yum 软件包:
[a@localhost]$rpm-qa|grepyum PackageKit-yum-1.0.7-6.el7.x86_64 yum-3.4.3-150.el7.noarchyum-Metadata-parser-1.1.4-10.el7.x86_64 yum-rhn-plugin-2.0.1-6.el7.noarchyum-langpacks-0.4.2-7.el7.noarchyum-utils-1.1.31-40.el7.noarch12345671234567
注意权限!!
删除yum包
[root@localhost]#rpm-ePackageKit-yum-1.0.7-6.el7.x86_64--nodeps[root@localhost]#rpm-eyum-3.4.3-150.el7.noarch--nodeps[root@localhost]#rpm-eyum-Metadata-parser-1.1.4-10.el7.x86_64--nodeps[root@localhost]#rpm-eyum-rhn-plugin-2.0.1-6.el7.noarch--nodeps[root@localhost]#rpm-eyum-langpacks-0.4.2-7.el7.noarch--nodeps123456123456
网易163网络源地址:http://mirrors.163.com/
这里寻找你要的包,
1,选centos
2,选择系统版本7.3.1611/
3,选择包类型(系统) os/
4,系统位数 x86_64/
5,包 Packages/
6,ctrl+f 搜索yum
7,一般需要如下的几个包
yum-plugin-fastestmirror
yum-updateonboot
yum-utils
yum-Metadata-parser
yum-3.4.3-150.el7
[root@localhost]#wgethttp://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm[root@localhost]#wgethttp://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-updateonboot-1.1.31-40.el7.noarch.rpm[root@localhost]#wgethttp://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-utils-1.1.31-40.el7.noarch.rpm[root@localhost]#wgethttp://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-Metadata-parser-1.1.4-10.el7.x86_64.rpm[root@localhost]#wgethttp://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm1234512345
安装
[root@localhost]#rpm-ivhyum-*警告:yum-3.4.3-150.el7.centos.noarch.rpm:头V3RSA/SHA256Signature,密钥IDf4a80eb5:NOKEY 准备中...#################################[100%] 正在升级/安装... 1:yum-Metadata-parser-1.1.4-10.el7#################################[20%]2:yum-plugin-fastestmirror-1.1.31-4#################################[40%] 3:yum-3.4.3-150.el7.centos#################################[60%]4:yum-updateonboot-1.1.31-40.el7#################################[80%] 5:yum-utils-1.1.31-40.el7#################################[100%]1234567891012345678910
配置
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Base.repo
将版本号那里改为你之前选择的那个版本
[base] name=CentOS-$releasever-Basebaseurl=http://mirrors.163.com/centos/7.3.1611/os/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.3.1611/os/x86_64/RPM-GPG-KEY-CentOS-7#releasedupdates[updates] name=CentOS-$releasever-Updatesbaseurl=http://mirrors.163.com/centos/7.3.1611/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.3.1611/os/x86_64/RPM-GPG-KEY-CentOS-7[extras] name=CentOS-$releasever-Extrasbaseurl=http://mirrors.163.com/centos/7.3.1611/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.3.1611/os/x86_64/RPM-GPG-KEY-CentOS-7#additionalpackagesthatextendfunctionalityofexistingpackages[centosplus] name=CentOS-$releasever-Plusbaseurl=http://mirrors.163.com/centos/7.3.1611/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirrors.163.com/centos/7.3.1611/os/x86_64/RPM-GPG-KEY-CentOS-71234567891011121314151617181920212223242512345678910111213141516171819202122232425
清理之前源,保证只有一个配置文件
[root@localhost]#yumcleanall[root@localhost]#ls/etc/yum.repos.d/CentOS-Base.repo12341234
安装你需要的软件测试是否正常使用
原文链接:https://www.f2er.com/centos/377488.html