linux制作离线yum源

1.打开yum缓存

vim /etc/yum.conf

指定缓存路径为/opt/yum
1表示打开缓存功能,在yum装包时会把rpm存到指定的路径下

在这里插入图片描述

2.创建/data/yum,把/opt/yum下的rpm包拷贝过来

在这里插入图片描述

3.安装createrepo,生成repodata目录

yum install createrepo -y
cd /data/yum
createrepo .

4.写yum配置文件/etc/yum.repos.d/local.repo

[k8s]
name=k8s repo
baseurl=file:///data/yum
enabled=1
gpgcheck=0
priority=1

5.yum repolist

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/anqixiang/article/details/107730910