centos 7.6镜像_Centos7 配置本地yum源为iso镜像

创建挂载路径
sudo mkdir /media/iso
挂载ISO镜像到目录
sudo mount -o loop CentOS-7-x86_64-Minimal-1810.iso /media/iso
下载地址: http://mirrors.sohu.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso

验证挂载
df -h
创建本地yum源配置文件
sudo touch /etc/yum.repos.d/local.repo
编辑local.repo文件内容
[local_server]
name=Thisis a local repo
baseurl=file:///media/iso
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
更新yum源
yum clean all 
yum makecache

 

posted @ 2022-06-16 23:23  xiaohaoge  阅读(1128)  评论(0编辑  收藏  举报