Chinaunix首页 | 论坛 | 博客
  • 博客访问: 370027
  • 博文数量: 132
  • 博客积分: 3066
  • 博客等级: 中校
  • 技术积分: 781
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-14 16:19
文章分类

全部博文(132)

文章存档

2012年(1)

2010年(50)

2009年(81)

我的朋友

分类:

2010-05-19 17:20:02

RHEL5系统 yum 默认使用光盘源方法

默认分类 2009-12-12 20:14:09 阅读62 评论0 字号:

rhel5 的yum默认无法从光盘安装软件,网络上教程一堆,但是没有一个完整可用的。经过试验总结如下
1.挂载光盘或镜像
#mount -o loop rhel5.iso /mnt/cdrom
#mount /dev/cdrom /mnt/cdrom

2. vi /etc/yum.repos.d/rhel-local.repo

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

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

[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=file:///mnt/cdrom/Server
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:///mnt/cdrom/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

3. mkdir -p /var/rhel/{Cluster,ClusterStorage,Server,VT}

4.
createrepo -o /var/rhel/Cluster -g /mnt/cdrom/Cluster/repodata/comps-rhel5-cluster.xml /mnt/cdrom/Cluster
createrepo -o /var/rhel/ClusterStorage -g /mnt/cdrom/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /mnt/cdrom/ClusterStorage
createrepo -o /var/rhel/Server -g /mnt/cdrom/Server/repodata/comps-rhel5-server-core.xml /mnt/cdrom/Server
createrepo -o /var/rhel/VT -g /mnt/cdrom/VT/repodata/comps-rhel5-vt.xml /mnt/cdrom/VT

5.
mount --bind /var/rhel/Cluster/repodata /mnt/cdrom/Cluster/repodata
mount --bind /var/rhel/ClusterStorage/repodata /mnt/cdrom/ClusterStorage/repodata
mount --bind /var/rhel/Server/repodata /mnt/cdrom/Server/repodata
mount --bind /var/rhel/VT/repodata /mnt/cdrom/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
阅读(632) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~