当前位置:网站首页>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
边栏推荐
- What can I do if I can't register didi? How to deal with it?
- [paper reading notes] a multilayered informational random walk for attributed social network embedding
- [论文阅读笔记] RoSANE, Robust and scalable attributed network embedding for sparse networks
- Exception: invalid or unexpected token
- 图-无向图
- 大专学历的我工作六年了,还有机会进大厂吗?
- 仅发送options请求,没有发送post解决方案
- Collection of blockchain theory [31]
- Several solutions to the problem that selenium webdriver always fails to use click
- Three ways to solve coursera video unable to watch
猜你喜欢

CSDN bug8: to be added

MultiBank Group宣布创纪录的财务业绩,2020年前三季度毛利达到9,400万美元

csdn bug6:待加

csdn bug3:待加
![[论文阅读笔记] Large-Scale Heterogeneous Feature Embedding](/img/00/df94bfe594e17ab120c30fd6b31931.jpg)
[论文阅读笔记] Large-Scale Heterogeneous Feature Embedding

Yixian e-commerce prospectus of perfect diary parent company: focusing on marketing and ignoring R & D, with a loss of 1.1 billion in the first three quarters

假如需要一百万个对象

奸商加价销售mate40,小米可望在高端手机市场夺取更多市场

csdn bug10:待加

Android quick shutdown app
随机推荐
图-无向图
selenium webdriver使用click一直失效问题的几种解决方法
csdn bug8:待加
Gets the property value of a column in the list collection object
Explanation of Z-index attribute
吴恩达《Machine Learning》精炼笔记 4:神经网络基础 - 知乎
世界上最伟大的10个公式,其中一个人尽皆知
CSDN bug9: to be added
注册滴滴加不上车怎么办?要怎么处理?
The length of the last word in leetcode
假如需要一百万个对象
CSDN BUG1: to be added
[论文阅读笔记] Large-Scale Heterogeneous Feature Embedding
Hong Kong listed companies transfer cards to acquire 42.5% equity of chuangxinzhong and plan to speed up the distribution of marketing services
大专学历的我工作六年了,还有机会进大厂吗?
C++ exception implementation mechanism
小度“破圈”提速,IoT迎来新故事
[elixir! 0073] beam built-in memory database ETS
浅谈字节最新开源联邦机器学习平台Fedlearner
【操作教程 】国标GB28181协议安防视频平台EasyGBS订阅功能介绍及开启步骤