yum-config-manager

yum-config-manager

   张吉吉     2020年11月19日 12:33     1837    

1.简介

yum-config-manager命令的本质是对/etc/yum.repos.d/(库数据的储存位置)文件夹下文件的管理。

 

2.安装

如果在系统上没有yum-config-manager命令的话,使用yum -y install yum-utils

 

3.添加仓库

执行完下边的命令后就会在/etc/yum.repos.d下产生源文件。

下边都是以centos7为例。

阿里云源

yum-config-manager --add-repo= http://mirrors.aliyun.com/repo/Centos-7.repo

yum-config-manager --add-repo=http://mirrors.aliyun.com/repo/epel-7.repo

163源:

yum-config-manager --add-repo=http://mirrors.163.com/.help/CentOS7-Base-163.repo

 

4.启用和禁用仓库

查看仓库

yum repolist all

1.png

 

启用仓库

yum-config-manager --enable centosplus

这样就启用了centosplus

 

禁用仓库

yum-config-manager --disable centosplus

 


文章评论

0

其他文章