rhel 5.5 配置 yum光盘源

        在网上搜索rhel 5.5下 yum 光盘源 居然没找到相关文章,无奈下只能自己研究,成功在rhel 5.5下配置了 yum 更新源为光盘。具体配置写出来和大家分享.

        以下在配置为在 Redhat 5.5 64位 桌面版 上实现yum 光盘源配置,仅供大家参考:

1.
#mount -o loop rhel5.iso /media/rhel  #光盘光盘镜像
#mount /dev/cdrom /media/rhel  #或者直接挂载光盘

2. vi /etc/yum.repos.d/rhel-local.repo  #修改yum配置文件,如果没有请新建。

[Client]
name=Red Hat Enterprise Linux $releasever - $basearch - Client
baseurl=file:///media/rhel/Client
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Workstation]
name=Red Hat Enterprise Linux $releasever - $basearch - Workstation
baseurl=file:///media/rhel/Workstation
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=file:///media/rhel/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


3. mkdir -p /var/rhel/{Client,Workstation,VT} #新建目录

4.
createrepo -o /var/rhel/Client -g /media/rhel/Client/repodata/comps-rhel5-client-core.xml /media/rhel/Client
createrepo -o /var/rhel/Workstation -g /media/rhel/Workstation/repodata/comps-rhel5-client-workstation.xml /media/rhel/Workstation
createrepo -o /var/rhel/VT -g /media/rhel/VT/repodata/comps-rhel5-vt.xml /media/rhel/VT

5.
mount --bind /var/rhel/Client/repodata /media/rhel/Client/repodata
mount --bind /var/rhel/Workstation/repodata /media/rhel/Workstation/repodata
mount --bind /var/rhel/VT/repodata /media/rhel/VT/repodata

6. yum clean all

7. vi /etc/yum.conf
[iso]
name=iso
baseurl=file:///mnt/cdrom/Server
gpgcheck=0

8. yum update

9. 现在可以任意安装了(装个apache试试)
#yum install httpd

本文出自 “[Redkey]_记录学习点滴…” 博客,转载请与作者联系!

你可能感兴趣的:(职场,yum,RHEL,休闲,5.5,光盘源)