CentOS 8 安装YUM源

备份默认YUM源文件

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir yum.bak
[root@localhost yum.repos.d]# ls
CentOS-AppStream.repo   CentOS-CR.repo         CentOS-Extras.repo     CentOS-Media.repo       CentOS-Vault.repo
CentOS-Base.repo        CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-PowerTools.repo  yum.bak
CentOS-centosplus.repo  CentOS-Devel.repo      CentOS-HA.repo         CentOS-Sources.repo
[root@localhost yum.repos.d]# mv *.repo yum.bak/
[root@localhost yum.repos.d]# ls
yum.bak
[root@localhost yum.repos.d]#

下载阿里源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

清除缓存:

[root@localhost yum.repos.d]# yum clean all

建立缓存:

[root@localhost yum.repos.d]# yum -y makecache
CentOS-8 - Base - mirrors.aliyun.com                                                                              1.6 MB/s | 4.6 MB     00:02    
CentOS-8 - Extras - mirrors.aliyun.com                                                                             26 kB/s |  10 kB     00:00    
CentOS-8 - AppStream - mirrors.aliyun.com                                                                         1.0 MB/s | 8.4 MB     00:08    
元数据缓存已建立。

查看仓库:

[root@localhost yum.repos.d]# yum repolist
仓库标识               仓库名称
AppStream             CentOS-8 - AppStream - mirrors.aliyun.com
base                  CentOS-8 - Base - mirrors.aliyun.com
extras                CentOS-8 - Extras - mirrors.aliyun.com

标题:CentOS 8 安装YUM源
作者:Curry
地址:http://bolo.it-cxy.top/articles/2024/11/18/1731919194173.html

    评论
    0 评论
avatar

取消