您的位置:首页 > 运维架构 > Linux

配置YUM 从centos5源更新软件

2011-05-09 21:17 585 查看
[root@fw ~]# rpm --import http://ftp.twaren.net/Linux/CentOS/RPM-GPG-KEY-CentOS-5
安装那个ftp.twaren.net的GPG,也可增加其他资源库,自己选择一个离自己地理位置近点
[root@clinet ~]# rpm -qa gpg-pubkey*
检查GPG Key
gpg-pubkey-e8562897-459f07a4
如果要删除Key,使用以下命令:
[root@clinet ~]# rpm -e gpg-pubkey-e8562897-459f07a4

[root@clinet ~]# vi /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
baseurl是你的YUM源地址
enabled=0
是否启用这个仓库,1为起用,0为禁用
gpgcheck=1
设置gpgcheck=1会让yum检查每个下载的RPM的GnuPG签名。这么做是因为你需要适当的GnuPG key注册到您的RPM数据库。可以防止被欺骗,如:非法入侵发行版网站,木马导入软件包,使不知情用户下载
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
GPGKEY 的存放地址

以上默认有的,复制添加以下更新点插入到rhel-debuginfo.repo文本里后面
[base]
name=Red Hat Enterprise Linux $releasever -Base
baseurl=http://ftp.twaren.net/Linux/CentOS/5/os/$basearch/
gpgcheck=1
[update]
name=Red Hat Enterprise Linux $releasever -Updates
baseurl=http://ftp.twaren.net/Linux/CentOS/5/updates/$basearch/
gpgcheck=1
[extras]
name=Red Hat Enterprise Linux $releasever -Extras
baseurl=http://ftp.twaren.net/Linux/CentOS/5/extras/$basearch/
gpgcheck=1
[addons]
name=Red Hat Enterprise Linux $releasever -Addons
baseurl=http://ftp.twaren.net/Linux/CentOS/5/addons/$basearch/
gpgcheck=1
[root@clinet ~]#yum clean all 清除缓存及旧的包本文出自 “None” 博客,请务必保留此出处http://evely.blog.51cto.com/1089422/562594
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: