先把安装光盘mount到系统中。
如果安装映像mount到/mnt/DVD目录下
[ncapp@nrb-ncapp-p01 ~]$ mount -l
/dev/mapper/vg_nrbncappp01-LogVol00 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_nrbncappp01-LogVol02 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sr0 on /media/RHEL-6.8 Server.x86_64 type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=0,gid=0,iocharset=utf8,mode=0400,dmode=0500) [RHEL-6.8 Server.x86_64]
/dev/sr0 on /mnt/DVD type iso9660 (ro) [RHEL-6.8 Server.x86_64]
本文主要是通过yum安装,所以需要修收配置文件, 通过vi /etc/yum.repos.d/rhel-source.repo,增加红色部分代码。
[ncapp@nrb-ncapp-p01 etc]$ cd yum.repos.d/
[ncapp@nrb-ncapp-p01 yum.repos.d]$ ls
packagekit-media.repo redhat.repo rhel-source.repo
[ncapp@nrb-ncapp-p01 yum.repos.d]$ cat rhel-source.repo
[local]
name=local
baseurl=file:///mnt/DVD
enabled=1
gpgcheck=0
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[nca