Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Linux培训 > » 正文

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.

[root@redhat ~]# mkdir /mnt/win # I want to mount windows partition to win folder

[root@redhat ~]# mkdir /mnt/iso # I want to mount RHEL5 ISO to iso folder

[root@redhat ~]# chmode -R 777 /mnt/win /mnt/iso # make sure there's enough privilage to access these two folders

[root@redhat ~]# 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

[root@redhat ~]# mount -a

[root@redhat ~]# /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.

[root@redhat ~]# cd /etc/yum.repos.d

[root@redhat ~]# cp rhel-debuginfo.repo rhel-debuginfo.repo.bak # Backup the default repo file

[root@redhat ~]# 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

[root@redhat ~]# 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/

Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史