# 1.安装基础命令包
[root@ansible ~]# yum install gcc gcc-c++ python3 python3-devel python3-createrepo_c python3-libdnf python3-libmodulemd libmodulemd
# 2.安装modulemd-tools-master工具
[root@ansible ~]# yum install -y modulemd-tools-master
# 3.安装nginx
[root@ansible ~]# yum install -y nginx
# 4.删除nginx发布目录下所有文件
[root@ansible ~]# rm -rf /usr/share/nginx/html/*
[root@ansible ~]# cd /usr/share/nginx/html/
# 5.开始克隆源
[root@ansible html]# reposync --repo=baseos
# 6.生成repodata目录
# createrepo_mod ./baseos与createrepo ./baseos一样
[root@ansible html]# createrepo_mod ./baseos
# 7.生成modules.yaml文件
[root@ansible html]# cd baseos
[root@ansible baseos]# repo2module ./
[root@ansible baseos]# ls
Packages modules.yaml repodata
# 8.设置nginx开机自启动
[root@ansible html]# systemctl enbale --now nginx
# 9.修改nginx配置文件
[root@ansible html]# vim /etc/nginx/nginx.conf
# yum发布页
location / {
root /usr/share/nginx/html;
autoindex on;
}
# 10.启动nginx
[root@ansible html]# systemctl start nginx
# 访问浏览器即可
rocky9.0本地局域网克隆yum源
于 2024-06-10 17:37:13 首次发布