目录
1、Centos7系列
(1)挂载ISO
方法1:(物理机)
[root@yczbora ~]# mount -o loop /backup/OracleLinux-Release7-Update6-x86_64-dvd.iso /mnt
方法2:(虚拟机)
[root@yczbora ~]# mount /dev/cdrom /mnt
(2)配置yum源
[root@yczbora ~]# cd /etc/yum.repos.d mkdir bk mv *.repo bk/ echo "[EL]" >> /etc/yum.repos.d/OL7.repo echo "name =Linux 7.x DVD" >> /etc/yum.repos.d/OL7.repo echo "baseurl=file:///mnt" >> /etc/yum.repos.d/OL7.repo echo "gpgcheck=0" >> /etc/yum.repos.d/OL7.repo echo "enabled=1" >> /etc/yum.repos.d/OL7.repo cat /etc/yum.repos.d/OL7.repo
(3)验证yum源是否ok:
[root@yczbora yum.repos.d]# yum clean all [root@yczbora yum.repos.d]# yum repolist [root@yczbora yum.repos.d]# yum list
2、Centos8系列
(1)挂载ISO
方法1:(物理机)
[root@yczbora ~]# mount -o loop /backup/OracleLinux-Release8-Update4-x86_64-dvd.iso /mnt
方法2:(虚拟机)
[root@yczbora ~]# mount /dev/cdrom /mnt
(2)配置yum源
[root@yczbora ~]# cd /etc/yum.repos.d
mkdir bk
mv *.repo bk/
echo "[EL]" >> /etc/yum.repos.d/OL8.repo
echo "name =Linux 8.x DVD" >> /etc/yum.repos.d/OL8.repo
echo "baseurl=file:///mnt/BaseOS" >> /etc/yum.repos.d/OL8.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/OL8.repo
echo "enabled=1" >> /etc/yum.repos.d/OL8.repo
cat /etc/yum.repos.d/OL8.repo
(3)验证yum源是否ok:
[root@yczbora yum.repos.d]# yum clean all [root@yczbora yum.repos.d]# yum repolist [root@yczbora yum.repos.d]# yum list