本地yum源配置

本地yum源配置
1.连接光盘文件

2.创建挂载点
mkdir /mnt/centos

3.把光盘文件挂载到目录上(挂载点)
mount /dev/cdrom /mnt/centos

4.设置开机自动挂载
vi /etc/fstab
/dev/cdrom /mnt/centos iso9660 defaults 0 0 ##添加这行配置到文件最下面

5.编辑本地yum源配置文件
cd /etc/yum.repos.d ##进入目录
mv Cent-Base.repo Cent-Base.repo.bak ##备份原来yum源配置文件
vi local.repo ##vi编辑一个本地yum源配置文件,并向里面添入内容
[local]
name=local
baseurl=file:///mnt/centos
enabled=1
gpgcheck=0

6.清除yum缓存,然后重新建立yum缓存
yum clean all
yum makecache

7.使用yum命令安装软件包 tree
yum -y install tree

CSDN博客链接 https://blog.csdn.net/DT_FlagshipStore/article/details/108842356

sh1ny2
原文地址:https://www.cnblogs.com/sh1ny2/p/13944897.html