redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题,另外CentOS公司去年已经被Redhat 收购了,不说费话了,我们还是来操作吧!
重装yum:
1、首先查看redhat 7.0系统本身所安装的那些yum 软件包:
[root@localhost ~]# rpm -qa | grep yum yum-utils-1.1.31-24.el7.noarch yum-langpacks-0.4.2-3.el7.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-rhn-plugin-2.0.1-4.el7.noarch PackageKit-yum-0.8.9-11.el7.x86_64 yum-3.4.3-118.el7.noarch
2、删除这些软件包:
[root@localhost ~]# rpm -e yum-3.4.3-118.el7.noarch --nodeps [root@localhost ~]# rpm -e yum-utils-1.1.31-24.el7.noarch --nodeps [root@localhost ~]# rpm -e yum-rhn-plugin-2.0.1-4.el7.noarch --nodeps [root@localhost ~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps [root@localhost ~]# rpm -e yum-langpacks-0.4.2-3.el7.noarch --nodeps [root@localhost ~]# rpm -e PackageKit-yum-0.8.9-11.el7.x86_64 –nodeps
3.下载所有yum软件包;
[root@localhost ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm [root@localhost ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm [root@localhost ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-24.el7.noarch.rpm [root@localhost ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-24.el7.noarch.rpm [root@localhost ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-24.el7.noarch.rpm
4、安装软件包:
[root@localhost ~]# rpm -ivh yum-* warning: yum-3.4.3-118.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 20%] 2:yum-plugin-fastestmirror-1.1.31-2################################# [ 40%] 3:yum-3.4.3-118.el7.centos ################################# [ 60%] 4:yum-updateonboot-1.1.31-24.el7 ################################# [ 80%] 5:yum-utils-1.1.31-24.el7 ################################# [100%
5.下载repos文件;
wget http://10.107.2.56/.help/CentOS7-Base.repo
配置:
一、删除RedHat自带的yum相关文件
1、文件位置:/etc/yum.conf和/etc/yum.repo.d/rhel-debuginfo.repo;
2、可以通过FTP方式删除,或者直接采用命令。
二、重新配置yum相关文件
1、配置yum.conf,创建yum.conf文件,再进行编辑即可;
yum.conf内容,可直接拷贝,如下:
[main] cachedir=/var/cache/yum keepcache=1 debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800
yum list