CentOS8 yum配置阿里源

CentOS8 yum配置阿里源

1.配置vmware虚拟网络
CentOS8 yum配置阿里源_第1张图片
CentOS8 yum配置阿里源_第2张图片

2.修改本机网卡(记得要和上一张图的ip网段相同,否则不成功)

CentOS8 yum配置阿里源_第3张图片
CentOS8 yum配置阿里源_第4张图片

CentOS8 yum配置阿里源_第5张图片

3.然后进入/etc/yum.repos.d目录

CentOS8 yum配置阿里源_第6张图片

4.创建目录backup(用于备份)
在这里插入图片描述

5.移动所有的repo文件进backup目录
在这里插入图片描述

6.复制 CentOS-Base.repo文件到/etc/yum.repos.d目录

在这里插入图片描述

7.编辑CentOS-Base.repo文件
在这里插入图片描述

8.修改配置

CentOS8 yum配置阿里源_第7张图片

gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that may be useful
[extras]
[ame=]entOS-$releasever-stream - Extras - mirrors.aliyun.com
[base]vermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever-stream/extras/$basearch/os/
[extras]http://mirrors.aliyuncs.com/centos/$releasever-stream/extras/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/extras/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

[base]ional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever-stream - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever-stream/centosplus/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/centosplus/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

[PowerTools]
name=CentOS-$releasever-stream - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever-stream/PowerTools/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/PowerTools/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official


[AppStream]
name=CentOS-$releasever-stream - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/AppStream/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

保存退出!

9.yum安装软件

yum install -y 软件包名
CentOS8 yum配置阿里源_第8张图片

你可能感兴趣的:(centos,运维,linux)