RHEL5配置YUM源

RHEL5 配置YUM源


cd /etc/yum.repos.d/
cp rhel-debuginfo.repo rhel-debuginfo.repo.bak
先删除rhel-debuginfo.repo文件中所有内容,然后添加以下内容:

[base]
name=CentOS-5 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&
repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons

baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras

baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/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 http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

更新:
yum update
本文出自
http://ironurbane.iteye.com/blog/444804
### 如何在RHEL 9中配置YUM #### 配置官方在线仓库 对于拥有有效订阅的用户来说,在安装完成后,RHEL 9默认已经配置好了官方的在线仓库。这意味着无需额外操作即可使用`yum`命令来更新系统或安装新的软件包。 然而,如果遇到提示“This system is not registered with an entitlement server”,则表明当前未注册到红帽客户门户网站。此时应该按照屏幕上的指示完成系统的登记过程,或者利用`subscription-manager register`命令来进行手动注册[^3]。 #### 设置本地ISO镜像作为YUM 当不具备互联网连接条件时,可以采用光盘或其他存储介质中的ISO文件创建本地库: 1. 将包含操作系统映像的DVD插入服务器并挂载至指定目录(假设为/mnt/cdrom),执行如下指令: ```bash mount /dev/sr0 /mnt/cdrom/ ``` 2. 创建一个新的`.repo`文件位于路径`/etc/yum.repos.d/local.repo`内,并编辑其内容如下所示: ```ini [local-rhel] name=Local RHEL Media baseurl=file:///mnt/cdrom/AppStream enabled=1 gpgcheck=0 ``` 请注意这里的`baseurl`指向的是实际存放rpm包的位置;而关闭GPG校验(`gpgcheck=0`)是为了简化流程,但在生产环境中建议开启此选项以保障安全性。 以上方法适用于那些希望基于物理媒介构建内部环境的情况。而对于大多数场景而言,推荐优先考虑通过网络访问官方资库的方式获取最新的安全补丁和技术支持服务[^1]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值