1.挂载磁盘:

[root@web1 ~]# cat /etc/fstab  | tail -1

/dev/cdrom /mnt iso9660 loop,defaults 0 0

[root@web1 ~]# mount –a

[root@web1 ~]# df -h | tail -1

/dev/sr0                      4.2G  4.2G    0 100% /mnt

2.搭建:

[root@web1 ~]# cat/etc/yum.repos.d/CentOS-6.repo

[local-yum]

name=CentOS-loal

baseurl=file:///mnt

gpgcheck=0

enabled=1

[root@web1 ~]# yum clean all

[root@web1 ~]# yum repolist