当前位置:网站首页>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
边栏推荐
- CSDN bug3: to be added
- Bifrost 位点管理 之 异构中间件实现难点(1)
- CCR coin robot: novel coronavirus pneumonia has accelerated the interest of regulators in CBDC.
- Connection to XXX could not be established. Broker may not be available
- 工厂方法模式
- [elixir! 0073] beam built-in memory database ETS
- Problems and solutions in configuring FTP server with FileZilla server
- CUDA_ Get the specified device
- Exception: invalid or unexpected token
- [leetcode] 93 balanced binary tree
猜你喜欢
[paper reading notes] a multilayered informational random walk for attributed social network embedding
csdn bug10:待加
[论文阅读笔记] Network Embedding with Attribute Refinement
CSDN bug3: to be added
jmeter接口测试--带有token的解决方法
极验无感验证破解
[论文阅读笔记] A Multilayered Informative Random Walk for Attributed Social Network Embedding
What's the difference between delete, truncate, and drop, and what to do if you delete data by mistake
The length of the last word in leetcode
leetcode1-两数之和
随机推荐
Enter C abstract to understand the similarities and differences between abstract classes and interfaces
Bifrost 位点管理 之 异构中间件实现难点(1)
jt-day10
Using tail as time series to identify whales
Fire knowledge online answer activity small program
仅发送options请求,没有发送post解决方案
Oschina: my green plants are potatoes, ginger and garlic
The length of the last word in leetcode
Getiservicemanager () source code analysis
Seam engraving algorithm: a seemingly impossible image size adjustment method
gnu汇编-基本数学方程-乘法
上线1周,B.Protocal已有7000ETH资产!
[paper reading notes] community oriented attributed network embedding
About CentOS start error: the solution of failed to start crash recovery kernel arming
注册滴滴加不上车怎么办?要怎么处理?
GNU assembly basic mathematical equations multiplication
Coding style: SSM environment in MVC mode, code hierarchical management
我手撸了一个划线翻译工具!
Collection of blockchain theory [31]
假如需要一百万个对象