当前位置:网站首页>本地yum源搭建
本地yum源搭建
2022-08-11 05:33:00 【zoujiangMr】
方案一:通过ISO镜像搭建yum源
1、下载镜像文件、
镜像文件官网链接
2、安装nginx
yum install -y nginx
systemctl enable nginx --now
配置
vim /etc/nginx/nginx.conf
修改nginx.conf文件,新增autoindex on; ,然后重启nginx
nginx 的默认网页文件路径为:/usr/share/nginx/html,在这个目录下 新增一个文件夹,起名为centos7。下面我们会把iso镜像文件挂载在这个目录下
3、挂载ISO镜像
挂载成功后,可以看到目录/usr/share/nginx/html/centos7/ 为iso镜像里面的内容。
# 挂载命令
[[email protected]_mtest ~]# mount -o loop /var/version/centos_rpm/CentOS-7-aarch64-Everything-2009.iso /usr/share/nginx/html/centos7/
[[email protected]_mtest ~]# ls /usr/share/nginx/html/centos7/
CentOS_BuildTag EFI EULA GPL images isolinux LiveOS Packages repodata RPM-GPG-KEY-CentOS-7 RPM-GPG-KEY-CentOS-Testing-7 TRANS.TBL
然后访问 http://IP/centos7/,就能看到我们刚才的挂载的镜像内容了
二、其他需要配置yum源的服务器操作
4、编写local.repo文件
[[email protected] /etc/yum.repos.d]# pwd
/etc/yum.repos.d
[[email protected] /etc/yum.repos.d]# ls
bak local.repo
[[email protected] /etc/yum.repos.d]# cat local.repo
[base]
name=centos-7
baseurl=http://192.168.1.1/centos7/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[[email protected] /etc/yum.repos.d] #
5、清楚缓存/重新加载yum源
[[email protected] /root]# yum clean all
33 files removed
[[email protected] /root]# yum makecache
centos-7 66 MB/s | 10 MB 00:00
Last metadata expiration check: 0:00:01 ago on Fri 19 Nov 2021 03:58:19 PM CST.
Metadata cache created.
[[email protected] /root]# yum repolist
Last metadata expiration check: 0:00:12 ago on Fri 19 Nov 2021 03:58:19 PM CST.
repo id repo name status
base centos-7 10,070
[[email protected] /root]#
方案二:通过下载RPM包、自定义yum仓库
边栏推荐
- 【LeetCode-349】两个数组的交集
- Jmeter RMI 反序列化命令执行漏洞复现
- Content Size Fitter的使用
- 无胁科技-TVD每日漏洞情报-2022-8-4
- No threat of science and technology - TVD vulnerability information daily - 2022-8-4
- 无胁科技-TVD每日漏洞情报-2022-7-27
- 2022年全国职业技能大赛网络安全竞赛试题B模块自己解析思路(7)
- Unity 数字跳字功能
- 勒索病毒eking.devos.mkp.makop.lockbit.eight.locked.roger等剖析及中毒文件恢复
- BaseActvity的抽取
猜你喜欢
随机推荐
非对称加密——网络安全
2022年全国职业技能大赛网络安全竞赛试题B模块自己解析思路(2)
Threatless Technology-TVD Daily Vulnerability Intelligence-2022-7-29
Lua 快速入门(一)——基础语法
中国移动通信集团有限公司:业务委托书
逐步揭示makop.mkp勒索病毒中毒防范恢复解密
解决win10安装portal v13/v15要求反复重启问题。
无胁科技-TVD每日漏洞情报-2022-7-28
无胁科技-TVD每日漏洞情报-2022-8-5
uboot代码解析1:根据目的找主线
UE4打包工程失败问题记录
【LeetCode-350】两个数组的交集II
lua杂记
Threatless Technology-TVD Daily Vulnerability Intelligence-2022-7-26
No threat of science and technology - TVD vulnerability information daily - 2022-8-4
脚本批量打包渠道包研究
Unity 使用双缓冲实现一个好用的计时器
无胁科技-TVD每日漏洞情报-2022-8-1
无胁科技-TVD每日漏洞情报-2022-7-20
Lua 快速入门(二)——函数(Function)