导读 | 今天给大家介绍一下rhel 7.6使用镜像做本地yum仓库 |
新建挂载文件夹
mkdir -p /mnt/dvd
将镜像挂载在本地
mount /dev/sr0 /mnt/dvd
新建仓库文件
vi /etc/yum.repo.d/rheliso.repo [rheliso] name=rheliso baseurl=file:///mnt/dvd enabled=1 gpgcheck=0 //验证1为验证0为跳过,一般为0 gpgkey=file:///RHISO/RPM-GPG-KEY-redhat-release//校验key,可不用
清除旧缓存
yum clean all
创建新缓存
yum makecache
验证是否成功
yum repolist
显示
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. 源标识 源名称 状态 rheliso rheliso 5,152 repolist: 5,152