Chinaunix首页 | 论坛 | 博客
  • 博客访问: 341054
  • 博文数量: 53
  • 博客积分: 2200
  • 博客等级: 大尉
  • 技术积分: 881
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-28 18:00
文章分类

全部博文(53)

文章存档

2010年(12)

2009年(33)

2008年(8)

我的朋友

分类: LINUX

2010-03-23 17:20:31

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
阅读(767) | 评论(0) | 转发(0) |
0

上一篇:玩转ptrace(二)

下一篇:自旋锁

给主人留下些什么吧!~~