![](/style/images/good.png)
4
![](/style/images/bad.png)
使用系统ISO镜像文件配置CentOS本地YUM源
source link: https://www.itwork.club/2021/11/11/config-yum/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
使用系统ISO镜像文件配置CentOS本地YUM源
Nov 11, 2021linux点击
配置 linux
的本地 yum
源需要先准备好CentOS.iso镜像文件,把下载好的 CentOS.iso
上传到服务器上
挂载镜像文件
将刚刚上传的镜像文件挂载到/home/iso/目录下(你可以挂载到自己的目录下,如果是挂载到镜像文件的路径,之前的镜像文件会被删除)
mount -o loop Centos7.6.iso /home/iso/
备份原yum源配置
mv /etc/yum.repos.d /etc/yum.repos.d.bak
创建本地yum源配置文件
mkdir /etc/yum.repos.d
vi /etc/yum.repos.d/CentOS-local.repo
# 本源的名字(不能和其他重复)
[base-local]
name=CentOS7.6-local
# 步骤2中挂载镜像创建的目录
baseurl=file:///home/iso
# 启动yum源: 1-启用 0-不启用
enabled=1
#安全检测: 1-开启 0-不开启
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
更新yum源配置
yum clean all
yum makecache
测试yum
yum list
#或者
yum repolis
以上,本地yum源就配置好了
原文作者: dgb8901,yinxing
原文链接: https://www.itwork.club/2021/11/11/config-yum/
版权声明: 转载请注明出处
![qrcode.jpg](https://www.itwork.club/img/qrcode.jpg)
体验小程序「简易记账」
![qrcode_mp.jpg](https://www.itwork.club/img/qrcode_mp.jpg)
关注公众号「特想学英语」
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK