2019-07-16 虚拟机内挂载ISO 设置本地yum

[root@localhost ~]# mount -o loop /root/CentOS-7-x86_64-DVD-1810.iso /data/centos_dvd
mount: /dev/loop0 is write-protected, mounting read-only
[root@localhost ~]# df /data/centos_dvd/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 4480476 4480476 0 100% /data/centos_dvd

[root@localhost ~]# ll /data/centos_dvd
total 686
-rw-rw-r--. 1 root root 14 Nov 25 2018 CentOS_BuildTag
drwxr-xr-x. 3 root root 2048 Nov 25 2018 EFI
-rw-rw-r--. 1 root root 227 Aug 30 2017 EULA
-rw-rw-r--. 1 root root 18009 Dec 9 2015 GPL
drwxr-xr-x. 3 root root 2048 Nov 25 2018 images
drwxr-xr-x. 2 root root 2048 Nov 25 2018 isolinux
drwxr-xr-x. 2 root root 2048 Nov 25 2018 LiveOS
drwxrwxr-x. 2 root root 663552 Nov 25 2018 Packages
drwxrwxr-x. 2 root root 4096 Nov 25 2018 repodata
-rw-rw-r--. 1 root root 1690 Dec 9 2015 RPM-GPG-KEY-CentOS-7
-rw-rw-r--. 1 root root 1690 Dec 9 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 Nov 25 2018 TRANS.TBL

vim /etc/yum.repos.d/CentOS-Base.repo
[centosplus] 随意
name=CentOS7 随意
failovermethod=priority
baseurl=file:///data/centos_dvd
gpgcheck=0
enabled=1
gpgkey=file:///data/centos_dvd/RPM-GPG-KEY-CentOS-7

你可能感兴趣的:(2019-07-16 虚拟机内挂载ISO 设置本地yum)