mkdir -p /mnt/cdrom/
  mount /dev/sr0 /mnt/cdrom
  [root@ht01 yum.repos.d]# cat local.repo
  [Server]
  name=Server
  baseurl=file:///mnt/cdrom
  enabled=1
  gpgcheck=0

  验证yum

[root@ht01 yum.repos.d]# yum repolist
Loaded plugins: langpacks, ulninfo
Server                                                                                                                                | 3.6 kB  00:00:00
(1/2): Server/group_gz                                                                                                                | 141 kB  00:00:00
(2/2): Server/primary_db                                                                                                              | 5.0 MB  00:00:00
repo id                                     repo name                                                                                                  status
Server                                      Server                                                                                                      5,210
ol7_UEKR5/x86_64                            Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64)                              183
ol7_latest/x86_64                           Oracle Linux 7Server Latest (x86_64)                                                                       15,970
repolist: 21,363

  

12-23 19:41