故障现象:
现象原因:
由于redhat 的更新包只对注册的用户生效,所以需要自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题,另外CentOS公司去年已经被Redhat 收购了
1、首先查看redhat 7.0系统本身所安装的那些yum 软件包:
rpm -qa | grep yum
2、卸载这些软件包
rpm -e yum-3.4.3-118.el7.noarch --nodeps
3、进入以下网站上面查看软件包的版本是否升级或者找到自己系统所对应的文件包版本更新
网易163网络源地址:http://mirrors.163.com/ CentOS网络源地址:http://centos.ustc.edu.cn/centos/
4、找到自己所需要的版本下载:
<pre>wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm</pre> <pre>wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm</pre> <pre>wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm</pre> <pre>wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-34.el7.noarch.rpm</pre> <pre>wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-34.el7.noarch.rpm</pre> <pre>wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
5、安装软件包:
上传RPM:
rpm -ivh python-chardet-2.2.1-1.el7_1.noarch.rpm rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm rpm -ivh yum-*
6、新建repo 配置文件
<pre>vim /etc/yum.repos.d/CentOS-Base.repo #CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$7 - Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/7/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$7 - Updates - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$7 - Extras - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$7 - Plus - 163.com baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7</pre>
7、yum clean all