配置源

时间:2019-08-22
本文章向大家介绍配置源,主要包括配置源使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

配置网络源
vim /etc/yum.repos.d

[epel1]
name = epel
enabled = 1
gpgcheck = 0
baseurl = https://mirrors.aliyun.com/epel/7/x86_64/
cost = 1

[centos]
name = centos base
enabled = 1
gpgcheck = 0
baseurl = http://mirrors.163.com/centos/7/os/x86_64/

----------------------------------------------------------------------------------------------------------------------------

下载docker时 还需要使用到extra和epel源
[extra]
name=centos extra
enabled=1
gpgcheck=0
baseurl=https://mirrors.aliyun.com/centos/7/extras/x86_64/


[epel]
name=epel
enabled=1
gpgcheck=0
baseurl=https://mirrors.aliyun.com/epel/7Server/x86_64/

----------------------------------------------------------------------------------------------------------------------------

本地源
[peng]
name=peng1
enabled=1
gpgcheck=0
baseurl=file:///mnt
----------------------------------------------------------------------------------------------------------------------------

如果下载失败 需要写入下面源
https://mirrors.aliyun.com/centos/7/os/x86_64/

----------------------------------------------------------------------------------------------------------------------------

配置后需要加载
yum clean all
yum repolist
mount /dev/cdrom /mnt 挂载

------------------------------------------------------------------------------------
K8s 下载docker 需要配置本地源
[peng]
name=peng1
enabled=1
gpgcheck=0
baseurl=file:///mnt

[os]
name=os
enabled=1
gpgcheck=0
baseurl=https://mirrors.aliyun.com/centos/7/os/x86_64/

原文地址:https://www.cnblogs.com/it-peng/p/11393828.html