CentOS7 配置光盘iso镜像为本地yum源


mount /dev/cdrom /mnt/把ISO挂载

把/etc/yum.repos.d/下面.repo文件先备份到其他地方

mv /etc/yum.repos.d/*.repo /tmp/

编辑新的yum源配置文件。

vi /etc/yum.repos.d/yum.repo

CentOS7 配置光盘iso镜像为本地yum源

[mnt]  name=mnt  baseurl=file:///mnt  enabled=1  gpgcheck=0

因为是本地挂载,不涉及数字签名问题,设置gpgcheck=0,不检查数字签名

清除yum缓存并缓存安装包信息

yum clean all

yum makecache

然后就可以开开心心的使用yum安装了。

最后记得使用umount /mnt卸载光盘。

© 版权声明
THE END
喜欢就支持一下吧
点赞9 分享