Centos7 搭建本地yum源方法

2024-10-13 07:46:38

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源方法
猜你喜欢