CentOS8 yum配置阿里源
1.配置vmware虚拟网络
2.修改本机网卡(记得要和上一张图的ip网段相同,否则不成功)
3.然后进入/etc/yum.repos.d目录
4.创建目录backup(用于备份)
5.移动所有的repo文件进backup目录
6.复制 CentOS-Base.repo文件到/etc/yum.repos.d目录
7.编辑CentOS-Base.repo文件
8.修改配置
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 软件包名