1.挂载iso
准备好centos的光盘镜像
挂载前的准备;
mkdir -p /dev/centos
mkdir -p /mnt/local_yum
挂载
mount -o loop /opt/software/CentOS-6.5-x86_64-bin-DVD1.iso /dev/centos/
拷贝文件
cp -r /dev/centos/* /mnt/local_yum/(大概4.2g,等待即可)
进入/mnt/local_yum/查看
2.配置yum文件
cd /etc/yum.repos.d/
(建议先对该目录下的repo文件进行备份)
cp CentOS-Media.repo local_yum.repo
vi local_yum.repo,把baseurl换成我们上面拷贝文件的/mnt/local_yum,enabled设置为1
更改好了之后
yum clean all
yum makecache(可省)
yum repolist all
卸载镜像umount /dev/centos