winnercn 发表于 2023-1-9 18:32:12

CentOS 8默认yum源成国内的阿里源

   CentOS默认yum源是国外的, 速度无法保证,用起来很不爽,今天我们把默认源换成国内的阿里源,阿里源是目前国内最好用的源,速度是相当快的。按照推荐的方法,也许会失败。错误:为 repo ‘base’ 下载元数据失败原因:源网址都是对应系统版本号的,现在的资料都是针历史版本的。修改源步骤:1.备份现有源mv /etc/yum.repos.d /etc/yum.repos.d.backup
2.设置新的yum目录mkdir /etc/yum.repos.d
3.安装wget(可不安装,我是失败了跳过,后面再安装就成功了)
yum install -y wget
4.下载配置(一定要区分自己的系统版本)CentOS 5wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repoCentOS 6wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repoCentOS 7wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoCentOS 8wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo5.清除文件并重建元数据缓存yum clean allyum makecache
6.最后更新软件包,这一步要下载安扎ung或升级一百多个软件包,比较费时间,大概三五分钟吧!yum update -y
页: [1]
查看完整版本: CentOS 8默认yum源成国内的阿里源