centos 8 - 安装阿里yum源

首先进入阿里官网:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11AmH9v0

官网中给出了详细的配置流程,这里为了方便复制了一份:

 1 配置方法
 2 通知:CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。
 3 
 4 1. 备份
 5 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
 6 2. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
 7 centos8(centos8官方源已下线,建议切换centos-vault源)
 8 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
 9 或者
10 
11 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
12 centos6(centos6官方源已下线,建议切换centos-vault源)
13 
14 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
15 或者
16 
17 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
18 CentOS 7
19 
20 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
21 或者
22 
23 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
24 3. 运行 yum makecache 生成缓存

其中用到了wget,在centos 8 mini版中没有此命令,可以使用curl。

安装上边的操作安装完以后,下载vim,会得到以下提示信息:

 

 提示信息中说没有匹配到vim,解决此问题也很简单,将/etc/yum.repos.d/目录下除CentOS-Base.repo其他文件全部删除并执行 yum clean all & yum makecache即可。

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章