当前位置:网站首页>CentOS7本地源yum配置
CentOS7本地源yum配置
2020-11-10 10:41:00 【osc_mxz6aybo】
CentOS7本地源yum配置
- 使用软件VMware Workstation 16pro
- 系统CentOS 7
- 镜像文件CentOS-7-x86_64-DVD-1511.iso
CentOS系统在虚拟机上或者真机上安装完后,想要安装软件有两种方法,除了本地源yum安装,还有网络安装,但是使用网络安装有时候会出现一些错误,所以建议先把本地源配置设置好。
打开虚拟机后在设置里连接下载好或者安装系统的镜像文件
要注意当镜像连接虚拟机成功之后,虚拟机右下角会显示
打开CentOS的终端输入
- 注:打开终端后建议先切换到root用户模式下
su root
df -h #查看已挂载的设备

- /dev/sr0 是镜像的设备名 后面的run/media/root/…是镜像的默认挂载路径 我们要重新设置挂载路径
- 先在mnt目录下创建cdrom,然后将镜像挂载到cdrom下
mount /dev/sr0 /mnt/cdrom/
- 挂载成功后会如图显示

- 设置挂载后进入到
cd /etc/yum.repos.d/目录下
vi CentOS-Media.repo
编辑次文件将里面的内容复制然后退出
使用 rm -f * 删除所有文件

然后自己创建一个.reop的文件如下

#文件代码如下
[a] #这里的两处a是创建的文件名
name=a
baseurl=file:///mnt/cdrom/ #这里是挂载的目录
gpgcheck=0 #不启用
enabled=1 #验证gpg不开启
#然后保存退出
因为重新设置了yum的配置所有要使用如下命令
yum clean alll #清除所有yum配置
yum makecache #建立yum的新缓存
成功会显示如下

最后查询已安装的软件包 yum list
到此CentOS本地源yum配置完成
版权声明
本文为[osc_mxz6aybo]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4271739/blog/4710550
边栏推荐
- C + + STL container
- 世界上最伟大的10个公式,其中一个人尽皆知
- 《Python Cookbook 3rd》笔记(2.2):字符串开头或结尾匹配
- getIServiceManager() 源码分析
- CCR炒币机器人:新冠肺炎加速了监管机构对CBDC的兴趣
- 完美日记母公司逸仙电商招股书:重营销、轻研发,前三季度亏11亿
- About CentOS start error: the solution of failed to start crash recovery kernel arming
- Oschina: my green plants are potatoes, ginger and garlic
- For programmers, those unfamiliar and familiar computer hardware
- learning to Estimate 3D Hand Pose from Single RGB Images论文理解
猜你喜欢

Notes on Python cookbook 3rd (2.2): String start or end match

What does the mremote variable in servicemanagerproxy refer to?

Use call, apply and bind to solve the annoying this in JS, this in event binding and parameter passing

mac终端Iterm2支持rz和sz的解决方案

Taulia推出国际支付条款数据库

csdn bug6:待加

【技术教程】Visual Studio 2017自建WebRTC中peerconnection_client程序报LNK2019 无法解析的外部符号错误

安卓快速关机APP

Explanation of Z-index attribute
![[论文阅读笔记] A Multilayered Informative Random Walk for Attributed Social Network Embedding](/img/3d/657a60600219ce6cfc514ad1b1bb49.jpg)
[论文阅读笔记] A Multilayered Informative Random Walk for Attributed Social Network Embedding
随机推荐
利用尾巴作为时间序列进行处理来识别鲸鱼
Ineuos industrial interconnection platform, web configuration (ineuview) increases the function of importing and exporting engineering views, as well as optimization and repair. Release: v3.2.1
Several solutions to the problem that selenium webdriver always fails to use click
CUDA_ Get the specified device
极验无感验证破解
csdn bug4:待加
吴恩达《Machine Learning》精炼笔记 4:神经网络基础 - 知乎
从大专生到蚂蚁金服CTO,他写下“支付宝”第一行代码:逆风的方向,更适合飞翔!...
Enter C abstract to understand the similarities and differences between abstract classes and interfaces
Connection to XXX could not be established. Broker may not be available
JS label syntax jumps out of multiple loops
[论文阅读笔记] Network Embedding with Attribute Refinement
CSDN BUG1: to be added
仅发送options请求,没有发送post解决方案
Overview of the most complete anomaly detection algorithm in history
JMeter interface test -- a solution with token
csdn bug7:待加
GNU assembly basic mathematical equations multiplication
B. protocal has 7000eth assets in one week!
【技术教程】Visual Studio 2017自建WebRTC中peerconnection_client程序报LNK2019 无法解析的外部符号错误