挂载yum源文件
1.检查yum源文件
[root@localhost~]# yum repolist

2.创建一个目录用来存放挂载文件
[root@localhost~]# mkdir -pv /dvd/cdrom
3.挂载
[root@localhost~]# mount /dev/sr0 /dvd/cdrom
4.查看挂载点
[root@localhost~]# df -h

5.修改配置
- 1.将后缀为repo文件移动到bak文件夹备份
 - 2.编辑cdrom.repo文件
[c7-media]
name=c7-media
baseurl=file:///dvd/cdrom/ //路径需与你光驱或ISO挂载的路径相同
gpgcheck=0 #yum源是否启用 1-启用 0-不启用
enabled=1 //enable后面值必须修改为1
[root@localhost~]# yum repolist

6.自动挂载
- 更改配置文件/etc/rc.local,让它开机自动挂载
[root@localhost~]# vi /etc/rc.local
写入mount /dev/sr0 /dvd/cdrom 
[root@localhost~]# chmod -v +x /etc/rc.local

7.reboot重启
8.查看挂载情况

|