当前位置:文档之家› RedHat 5的yum源配置

RedHat 5的yum源配置

关于RedHat 5U3的yum源配置
1,yum本地源的配置与使用
a:挂载你的光盘到一个目录下:mount -t iso9660 /dev/cdrom /mnt/cdrom
b:修改你的yum配置文件:编辑 /etc/yum.repos.d/rhel-debuginfo.repo 文件,里面有给
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
主要是baseurl,enabled,gpgcheck字段的配置,本地就是要使用file://absolute path.
保存并退出。
c:yum update
这里有想必大家有个疑问,光盘放进光驱后,如果能识别的话就已经自动挂载到了/media 下为什么我们还要费事手动挂载呢?这个倒是必须的,因为你不挂载的话你yum需要的repodata文件是没有任何东西的,因为yum要去读这个文件才会自动给你解决依赖关系的。
还有一个想要与大家一起学习的就是,在你没有盘,只有iso文件时怎么办?很简单,一条命令解决 mount -o loop /xx/xx/xxx.iso /mnt/cdrom你可以继续了。呵呵~
2、网络源的配置
这些是我吸取前辈的精华,同样是修改上面所提到的配置文件里的内容:
[base]
name=CentOS-5 - Base
#mirrorlist=https://www.doczj.com/doc/1310097892.html,/?release=$releasever5&arch=$basearch&
repo=os
#baseurl=https://www.doczj.com/doc/1310097892.html,/centos/$releasever/os/$basearch/
baseurl=https://www.doczj.com/doc/1310097892.html,/centos/5/os/$basearch/
gpgcheck=1
gpgkey=https://www.doczj.com/doc/1310097892.html,/centos/RPM-GPG-KEY-centos5
#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=https://www.doczj.com/doc/1310097892.html,/?release=4&arch=$basearch&repo=updates
baseurl=https://www.doczj.com/doc/1310097892.html,/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=https://www.doczj.com/doc/1310097892.html,/centos/RPM-GPG-KEY-centos5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=https://www.doczj.com/doc/1310097892.html,/?release=4&arch=$basearch&repo=addons
baseurl=https://www.doczj.com/doc/1310097892.html,/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=https://www.doczj.com/doc/1310097892.html,/centos/RPM-GPG-KEY-centos5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=https://www.doczj.com/doc/1310097892.html,/?release=4&arch=$basearch&repo=extras
baseurl=https://www.doczj.com/doc/1310097892.html,/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=https://www.doczj.com/doc/1310097892.html,/centos/RPM-GPG-KEY-centos5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
#mirrorlist=https://www.doczj.com/doc/1310097892.html,/?release=4&arch=$basearch&repo=centosplus
baseurl=https://www.doczj.com/doc/1310097892.html,/centos/5/

centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://www.doczj.com/doc/1310097892.html,/centos/RPM-GPG-KEY-centos5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=https://www.doczj.com/doc/1310097892.html,/?release=4&arch=$basearch&repo=contrib
baseurl=https://www.doczj.com/doc/1310097892.html,/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://www.doczj.com/doc/1310097892.html,/centos/RPM-GPG-KEY-centos5
# vi dag.repo
[dag]
name=Dag RPM Repository for RHEL5
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
enabled=1
gpgcheck=1
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt
再者导入key rpm --import https://www.doczj.com/doc/1310097892.html,/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

相关主题
文本预览
相关文档 最新文档