当前位置:文档之家› redhat6.6配置使用centos的yum源

redhat6.6配置使用centos的yum源

#contrib - packages by Centos Users [contrib] name=CentOS-6.5 - Contrib - baseurl=ht t p :///cent os/6/cont rib/$basearch/ #mirrorlist =ht t p ://mirrorlist .cent /?release=6.5&arch=$basearch&rep o=cont rib gp gcheck=1 enabled=0 gpgkey=/centos/RPM -GPG-KEY-CentOS-6
5、更新 yum 源 在/etc/yum.repos.d/目录下去除原有的*.repo 文件,新建一个新的 Base.repo 文件,该文件的内容如下: (注意,文件中相应的 baseurl 需要确保路径正确,所以有必要检查实际的 ftp 镜像路劲是否存在) # 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 mirБайду номын сангаасorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # #
redhat6.6 配置使用 centos 的 yum 源
redhat 默认自带的 yum 源需要注册,才能更新。我们想不花钱也可以更新,需要替换掉 redhat 的 yum 源,具体的实现方式如下: 1、检查是否安装 yum 包 查看 RHEL 是否安装了 yum,若是安装了,那么又有哪些 yum 包: [root@localhost ~]# rpm -qa |grep yum y um-met adat a-p arser-1.0-8.fc6 y um-3.0.1-5.el5 y um-rhn-p lugin-0.4.3-1.el5 y um-up dat esd-3.0.1-5.el5 2、删除 redhat 自带的 yum 包 卸载上面显示的所有 yum 包: [root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps(不检查依赖,直接删除 rpm 包) 再用 [root@localhost ~]# rpm -qa |grep yum [root@localhost ~]# 查看,无信息显示表示已经卸载完成。 3、下载新的 yum 包。使用 Centos6.5 的 yum 包 # wget /centos/6.6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm # wget /centos/6.6/os/i386/Packages/yum-3.2.29-60.el6.centos.noarch.rpm # wget /centos/6.6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
#additional packages that extend functionality of existing packages [cent osp lus] name=CentOS-6.5 - Plus - baseurl=ht t p :///cent os/6/cent osp lus/$basearch/ #mirrorlist =ht t p ://mirrorlist .cent /?release=6.5&arch=$basearch&rep o=cent osp lus gp gcheck=1 enabled=0 gpgkey=/centos/RPM -GPG-KEY-CentOS-6
#additional packages that may be useful [extras] name=CentOS-6.5 - Extras - baseurl=ht t p :///cent os/6/ext ras/$basearch/ #mirrorlist =ht t p ://mirrorlist .cent /?release=6.5&arch=$basearch&rep o=ext ras gp gcheck=1 gpgkey=/centos/RPM -GPG-KEY-CentOS-6
4、安装 yum 软件包 注意:单个的安装包可能会依赖其它包(例如 yum 和 yum-fastestmirror 会相互依赖),所以我们可以把所有 这些包放在一起,用一行命令将它们同时安装即可: rpm –ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm yum-3.2.29-60.el6.centos.noarch.rpm y um-p lugin-fast est mirror-1.1.30-30.el6.noarch.rp m
#released updates [up dat es] name=CentOS-6.5 - Updates - baseurl=ht t p :///cent os/6/up dat es/$basearch/ #mirrorlist =ht t p ://mirrorlist .cent /?release=6.5&arch=$basearch &rep o=up dat es gp gcheck=1 gpgkey=/centos/RPM -GPG-KEY-CentOS-6
6 、 清 除原有缓存 yum clean all 7 、 重 建缓存,以提高 搜索安装软件的速度 yum makecache 8 、 更 新系统 yum update
至此就完成对 yum 源的配置,接下来就可使用 yum 进行软件升级与安装。
[base] name=CentOS-6.5 - Base -
baseurl=ht t p :///cent os/6/os/$basearch/ #mirrorlist =ht t p ://mirrorlist .cent /?release=6.5&arch=$basearch&rep o=os gp gcheck=1 gpgkey=/centos/RPM -GPG-KEY-CentOS-6
相关主题