環境:
Os:oracle linux 7
1.刪除原來的yum檔案
[root@localhost yum.repos.d]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# mv oracle-linux-ol7.repo oracle-linux-ol7.repo_bak
[root@localhost yum.repos.d]# mv uek-ol7.repo uek-ol7.repo_bak
[root@localhost yum.repos.d]# mv virt-ol7.repo virt-ol7.repo_bak
2.掛載ios檔案
[root@19c ios]# mount OracleLinux-R7-U9-Server-x86_64-dvd.iso -o loop /mnt
3.新增本地yum檔案
[root@localhost yum.repos.d]# more local.repo
[base]
name=RedHat
baseurl=file:///mnt
enabled=1
gpgckeck=0
gpgkey=file:///mnt/RPM-GPG-KEY-oracle
4.清除快取
yum clean all