Centos 6.5 ISO 文件挂载方法

创建一个目录
mkdir /media/rhel/

挂载iso到/media/rhel/
mount -o loop /media/iso/CentOS-6.5-x86_64-bin-DVD1.iso /media/rhel/

cd  /etc/yum.repos.d/ 两个文件改名,绕过网络安装

mv CentOS-Base.repo CentOS-Base.repose_bak
mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo_bak

vi /etc/yum.repos.d/CentOS-Media.repo
[HZ-media]                     

name=CentOS 6.5               

baseurl=file:///media/rhel/     

gpgcheck=1                     

enabled=1                      

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

开机自动挂载
vi /etc/rc.d/rc.local
mount -o loop /media/iso/CentOS-6.5-x86_64-bin-DVD1.iso /media/rhel/

测试YUM
yum list

清除yum缓存
yum clean all

安装YUM 测试
yum install vim

你可能感兴趣的:(Centos)