[root@node130 rh]# pwd
/opt/rh
[root@node130 rh]# ls
rhel-server-6.4-x86_64-dvd.iso
[root@node130 rh]#mkdir /mnt/cdrom
[root@node130 dev]# mount -v -t iso9660 -o loop /opt/rh/rhel-server-6.4-x86_64-dvd.iso /mnt/cdrom/
mount: going to use the loop device /dev/loop0
/opt/rh/rhel-server-6.4-x86_64-dvd.iso on /mnt/cdrom type iso9660 (rw,loop=/dev/loop0)
[root@node130 yum.repos.d]# vim rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
清除原有缓存
[root@node130 cdrom]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: rhel-source
Cleaning up Everything
获取yum列表
验证yum配置是否成功
[root@node130 cdrom]# yum makecache
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel-source | 3.9 kB 00:00 ...
rhel-source/group_gz | 204 kB 00:00 ...
rhel-source/filelists_db | 3.7 MB 00:00 ...
rhel-source/primary_db | 3.1 MB 00:00 ...
rhel-source/other_db | 1.5 MB 00:00 ...
Metadata Cache Create
验证yum配置是否成功
[root@node130 cdrom]# yum grouplist | grep Server
Network Infrastructure Server
Print Server
Web Server
Backup Server
Directory Server
Identity Management Server
Network Storage Server
Server Platform
Server Platform Development
Systems Management Messaging Server support