redhat yum from iso

Today I picked up Redhat again for the RHCE exam is coming soon.

After installing the basic system, meet problem, I need to do some DNS practice. But I don't like install the rpm package from DVD, I just want to yum it from the ISO source. So in order to make a good practice environment. I did the following steps:

1. mount the ISO file first and make it startup by system every time.

# mkdir /mnt/win # I want to mount windows partition to win folder

# mkdir /mnt/iso # I want to mount RHEL5 ISO to iso folder

# chmode -R 777 /mnt/win /mnt/iso # make sure there's enough privilage to access these two folders

# fdisk -l # Display all the partition

From the /etc/fstab, add this line:

/dev/hda1 /mnt/win ntfs umask=000 0 0 # This means to mount the NTFS partition when system startup

in /etc/rc.d/rc.local, add this line:

mount -o loop /mnt/win/ISO/rhel-5-server-i386-dvd.iso /mnt/iso # This means to mount ISO file to /mnt/iso folder when system startup

# mount -a

# /etc/rc.local # These two lines means to mount NTFS partition to /mnt/win first, then mount ISO file to /mnt/iso



2. Edit the repo file to make iso as yum source.

# cd /etc/yum.repos.d

# cp rhel-debuginfo.repo rhel-debuginfo.repo.bak # Backup the default repo file

# vim rhel-debuginfo.repo

edit the repo file like this:

[Server]
name=Red Hat Enterprise Linux ISO image
baseurl=file:///mnt/iso/Server/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[VT]
name=VT
baseurl=file:///mnt/iso/VT/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Please pay attention to the path. After finish the repo file. you can use yum, but first you must check the update

# yum check-update # If you find there are several 100% and no error, then everything will be fine!

[zz]http://zhouxuesong1980.blog.163.com/blog/static/76945154200932821525820/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值