Centos7 搭建本地yum源方法

2025-05-25 17:43:48

1、系统还是CentOS 7

Centos7 搭建本地yum源方法

2、准备好镜像文件CentOS-7-x86_64-DVD-1908.iso

Centos7 搭建本地yum源方法

3、挂载iso文件到/mnt目录mount -o loop CentOS-7-x86_64-DVD-1908.iso /mnt/

Centos7 搭建本地yum源方法

4、备份原yum源配置mv /etc/yum.repos.d /etc/yum.repos.d.bak

Centos7 搭建本地yum源方法

5、创建新的目录和yum源mkdir /etc/yum.repos.dvi /etc/yum.repos.d/CentOS-local.repo

Centos7 搭建本地yum源方法

6、 [root@localhost mnt]# vi /etc/yum.repos.d/CentOS-local.repo#本源的名字(不能和其他重复)[base-local]name=CentOS7.7-local#步骤2中挂载镜像创建的目录baseurl=file:///mnt#启动yum源: 1-启用 0-不启用enabled=1#安全检测: 1-开启 0-不开启gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7~

Centos7 搭建本地yum源方法

7、更新yum源配置yum clean allyum makecache

Centos7 搭建本地yum源方法

8、安装软件成功

Centos7 搭建本地yum源方法
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢