Centos7 搭建本地yum源方法

 时间:2026-02-12 21:45:47

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.d

vi /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=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

~                                                    

Centos7 搭建本地yum源方法

7、更新yum源配置

yum clean all 

yum makecache

Centos7 搭建本地yum源方法

8、安装软件成功

Centos7 搭建本地yum源方法

  • 数据结构中几种经典排序简介
  • Firefox浏览器,文件下载后保存去哪里?
  • U8 VMI业务流程操作步骤
  • 冬天如何防止皮肤皴裂?
  • 【软件】如何在WPS或Word中插入伪代码?
  • 热门搜索
    韶山旅游攻略 南澳岛旅游 房山旅游景点大全 少林寺旅游 日本旅游必去的地方 六月份适合去哪里旅游 广州广之旅旅游官网 雪乡旅游 沙坡头旅游攻略 瑞士旅游攻略