怎么配置本地yum源 配置yum源文件



文章插图
怎么配置本地yum源 配置yum源文件

文章插图
配置本地YUM源
yum的一切配置信息都储存在一个叫yum.repos.d的配置文件中,通常位于/etc/yum.repos.d目录下
删除原有的文件
[[email protected] yum.repos.d]#rm -rf /etc/yum.repos.d/*
创建一个新的yum源配置文件,yum源配置文件的结尾必须是.repo
[[email protected] yum.repos.d]# vim CentOS7.repo #写入以下红色内容
[CentOS7]
name=CentOS-server
baseurl=file:///mnt
enabled=1
【怎么配置本地yum源 配置yum源文件】gpgcheck=0
参数说明:
[CentOS7] —>yum的ID,必须唯一
name=CentOS-server —–>描述信息
baseurl=file:///mnt ——-> /mnt表示的是光盘的挂载点 . file:后面有3个///
enabled=1 ——>启用
gpgcheck=0 —->取消验证
清空并生成缓存列表
[[email protected] ~]# yum clean all #清空yum缓存
[[email protected] ~]# yum list #生成缓存列表
验证一下
[[email protected] ~]# yum -y install httpd