#!/bin/bash# vflong 2014-4-3# CentOS 6.4PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbinexport PATHBASEDIR=/etc/yum.repos.dmkdir -p /mnt/dvdmount /dev/cdrom /mnt/dvd 2> /dev/nullrm -rf $BASEDIR/CentOS-*echo "[Packages]name=Packagesbaseurl=file:///mnt/dvdgpgcheck=0enabled=1" > $BASEDIR/yum.repoyum clean allyum repolist all
备注:
1. 测试系统为CentOS 6.4裸机
2. 关闭SELinux
3. 关闭iptables
4. 运行此程序之前,需手动在VBox设置中手动挂载DVD1