CentOS7挂载镜像为本地YUM源

将镜像文件拷贝至Linux文件目录,如/usr/local/src

mkdir  /media/centos7

mount /usr/local/src/centos7.iso  /media/centos7

 

rm  -rf  /etc/yum.repos.d/*

vim /etc/yum.repos.d/centos7-localsource.repo

输入内容:

[centos7-localsource]

name=centos7

baseurl=file:///media/centos7

enabled=1

gpgcheck=0

保存退出

 

 

yum makecache

yum clean all

yum  list

安装软件:yum -y install net-tools*

 

你可能感兴趣的:(1)