目录
一.新建文件夹并挂载镜像
[root@localhost ~]# mkdir /openeuler/
[root@localhost ~]# mount /dev/sr0 /openeuler/
mount: /openeuler: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# ls /openeuler/
docs EFI images isolinux ks Packages repodata RPM-GPG-KEY-openEuler TRANS.T
二.编辑开机自运行脚本
[root@localhost ~]# vim /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
mount /dev/sr0 /openeuler/
三.设置权限
[root@localhost ~]# chmod +x /etc/rc.d/rc.local
四.重启
[root@localhost ~]# reboot
五.重启后查看是否成功自动挂载
出现红框内容说明成功
六.指定软件仓库
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
openEuler.repo
七.对原文件进行缓存处理
[root@localhost yum.repos.d]# mv openEuler.repo openEuler.repo.bak
[root@localhost yum.repos.d]# ls
openEuler.repo.bak
八.写新文件
[root@localhost yum.repos.d]# vim openEuler.repo
[openEuler]
name=openEuler
baseurl=file:///openeuler/
gpgcheck=0
九.下载并更新软件包仓库的元数据缓存
[root@localhost yum.repos.d]# dnf makecache