手动配置yum源文件(CentOS8)
Posted wuvikr
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了手动配置yum源文件(CentOS8)相关的知识,希望对你有一定的参考价值。
1. 备份
mkdir /etc/yum.repos.d/repo.bak ; mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo.bak
2. 配置yum源文件
vim /etc/yum.repos.d/CentOS8.repo
1 [baseOS] 2 name=baseOS 3 baseurl=https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/ 4 https://mirrors.huaweicloud.com/centos/8/BaseOS/x86_64/os/ 5 https://mirrors.163.com/centos/8/BaseOS/x86_64/os/ 6 gpgcheck=1 7 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official 8 9 [AppStream] 10 name=AppStream 11 baseurl=https://mirrors.aliyun.com/centos/8/AppStream/x86_64/os/ 12 https://mirrors.huaweicloud.com/centos/8/AppStream/x86_64/os/ 13 https://mirrors.163.com/centos/8/AppStream/x86_64/os/ 14 gpgcheck=1 15 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official 16 17 18 [epel] 19 name=epel 20 baseurl=https://mirrors.aliyun.com/epel/8/Everything/x86_64/ 21 gpgcheck=1 22 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 23 24 [extras] 25 name=extras 26 baseurl=https://mirrors.aliyun.com/centos/8/extras/x86_64/os/ 27 gpgcheck=1 28 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
3.清除缓存并生效
dnf clean all ; dnf makecache ; dnf repolist
以上是关于手动配置yum源文件(CentOS8)的主要内容,如果未能解决你的问题,请参考以下文章
运维笔记:linux(centos8)yum安装nginx最新版及配置文件