Linux配置系统yum源

首先是需要你把需要使用的镜像挂载到系统上面,可以通过cd /dvd添加也可以直接上传到系统上

本文档是上传到系统上进行挂载

操作系统:Red Hat 7.6

挂载镜像:Red Hat 7.6

1.挂载镜像

mount /tmp/rhel-server-7.6-x86_64-dvd.iso /mnt/

 

2.配置yum文件

先使用yum install telnet 看是否会提醒以下问题

[root@localhost ~]# yum install telnet
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
No package telnet available.
Error: Nothing to do
[root@localhost ~]# 

如果有以上问题请使用

yum remove subscription-manager

配置yum源

vim /etc/yum.repos.d/redhat.repo
#添加一下内容,注意挂载镜像路径
[local]
name=Red Hat Enterprise Linux 7.7
baseurl=file:///mnt
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-release

使用一下清除yum缓存

yum clean all 

这就配置成功了,可以进行yum测试

 

posted @     阅读(751)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示