文章目录
- 一、主旨
- 二、步骤
- 2.1 如果repo配置文件名存在冲突先备份
- 2.2 下载repo配置文件
- 2.3 清除所有头文件、包文件并建立缓存
一、主旨
这里主要介绍如何给 RHEL 8 / CentOS 8 配置网络yum源
二、步骤
2.1 如果repo配置文件名存在冲突先备份
复制代码
1
2[root@linuxprobe yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bk
2.2 下载repo配置文件
当前示例是阿里云镜像,这里同时也把其他几大镜像站及配置方法放出供参考:
阿里云 CentOS 8 配置
腾讯云 CentOS 8 配置
清华tuna CentOS 8 配置
网易163 CentOS 7 配置
复制代码
1
2[root@linuxprobe ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
这里我们可以看看下载的文件,这里主要的参数包含:
1.baseurl :地址
2.gpgcheck:是否校验
3.gpgkey:校验公钥(这里采用的是url,也可以自行下载配置本地地址)
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ gpgcheck=1 enabled=0 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [PowerTools] name=CentOS-$releasever - PowerTools - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/ gpgcheck=1 enabled=0 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [AppStream] name=CentOS-$releasever - AppStream - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
2.3 清除所有头文件、包文件并建立缓存
dnf也是相同的操作
复制代码
1
2
3yum clean all yum makecache
最后
以上就是坚定钢笔最近收集整理的关于rhel8配置centos8 yum网络源一、主旨二、步骤的全部内容,更多相关rhel8配置centos8内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复