1. Mount the disc
#挂载光盘 Mount /dev/cdrom/mnt/cdrom
2. Modify yum.conf, run vi/etc/yum.conf, replace the file with the following content
[Main]cachedir=/var/cache/yum/$basearch/$releaseverkeepcache=0 DebugLevel=2logfile=/var/log/yum. Logexactarch=1 Obsoletes=1gpgcheck=0Plugins=1installonly_ Limit=3
3. Go to/ETC/YUM.REPOS.D backup Rhel-source.repo
CP Rhel-source.repo Rhel-source.repo.bak
4. Modify the Rhel-source.repo file and replace it with the following:
[rhel-Source]name=red Hat Enterprise Linux $releasever-$basearch-Sourcebaseurl=file:///Mnt/cdromEnabled=1Gpgcheck=0Gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-redhat-release[Rhel-source-Beta]name=red Hat Enterprise Linux $releasever beta-$basearch-Sourcebaseurl=FTP://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/srpms/Enabled=0Gpgcheck=1Gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-redhat-beta,file:///Etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
5. Test Yum
Yum List
Linux configuration local Yum