作者:【吳業亮】雲計算開發工程師
博客:http://blog.csdn.net/wylfengyujiancheng
redhat 的更新包只對注冊的用戶生效,所以我們自己手動更改成CentOS 的更新包,CentOS幾乎和redhat是一樣的,所以無需擔心軟件包是否可安裝,安裝之後是否有問題。
1、首先刪除redhat原有的yum ,因為redhat 原本的yum 沒有注冊為redhat用戶是用不了的。
rpm -aq|grep yum|xargs rpm -e --nodeps
rpm -aq|grep python-iniparse|xargs rpm -e --nodeps 12
2、下載163的yum 安裝包
# wgethttp://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm# wgethttp://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm # wgethttp://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm # wgethttp://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm 1234
3、安裝下載的rpm包
rpm -ivh *.rpm1
4、創建文件/etc/yum.repos.d/rhel-debuginfo.repo並寫入
[base]
name=CentOS-$releasever - Basebaseurl=http://mirrors.163.com/centos/7.2.1511/os/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7#released updates[updates]
name=CentOS-$releasever - Updatesbaseurl=http://mirrors.163.com/centos/7.2.1511/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7[extras]
name=CentOS-$releasever - Extrasbaseurl=http://mirrors.163.com/centos/7.2.1511/extras//$basearch/
gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7[centosplus]
name=CentOS-$releasever - Plusbaseurl=http://mirrors.163.com/centos/7.2.1511/centosplus//$basearch/
gpgcheck=1enabled=01234567891011121314151617181920212223242526
6、 yum clean all
7、 yum update 測試。8、 安裝 epel 源
# yum install epel-release