关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

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

发布时间:2023/11/25 13:46:59
香港云服务器

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

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

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

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

yum clean all

yum makecache

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

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