CentOS Stream 9 centos9 配置国内源 阿里云源
CentOS Stream 9 centos9 配置国内源 阿里云源

CentOS Stream 9 centos9 配置国内源 阿里云源

  • yum配置文件路径 /etc/yum.repos.d/centos.repo
  • 备份源配置 mv /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.backup
  • 阿里源配置
  • 更新缓存 yum makecache && yum update

yum配置文件路径

/etc/yum.repos.d/centos.repo

备份源配置

mv /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.backup

阿里源配置

vi /etc/yum.repos.d/centos.repo

替换为下面的

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/os/
        http://mirrors.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
 
#additional packages that may be useful
#[extras]
#name=CentOS-$releasever - Extras - mirrors.aliyun.com
#failovermethod=priority
#baseurl=https://mirrors.aliyun.com/centos-stream/$stream/extras/$basearch/os/
#        http://mirrors.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/
#        http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/
#gpgcheck=1
#gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/centosplus/$basearch/os/
        http://mirrors.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
 
[PowerTools]
name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/PowerTools/$basearch/os/
        http://mirrors.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official


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

更新缓存 yum makecache && yum update

yum makecache && yum update

[root@cheng ~]# yum makecache && yum update
CentOS-9 - Base - mirrors.aliyun.com                                                       51 kB/s | 3.9 kB     00:00    
CentOS-9 - AppStream - mirrors.aliyun.com                                                  37 kB/s | 4.4 kB     00:00    
CentOS Stream 9 - Extras packages                                                          31 kB/s | 8.9 kB     00:00    
cuda-rhel9-x86_64                                                                          10 kB/s | 3.5 kB     00:00    
Docker CE Stable - x86_64                                                                  14 kB/s | 3.5 kB     00:00    
Extra Packages for Enterprise Linux 9 - x86_64                                             22 kB/s | 5.0 kB     00:00    
Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64                      4.1 kB/s | 993  B     00:00    
Extra Packages for Enterprise Linux 9 - Next - x86_64                                      60 kB/s |  17 kB     00:00    
元数据缓存已建立
上次元数据过期检查0:00:01 执行于 2024年12月22日 星期日 15时52分33秒
依赖关系解决
无需任何处理
完毕

0 0 投票数
文章评分
订阅评论
提醒

0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x

了解 码奋 的更多信息

立即订阅以继续阅读并访问完整档案。

Continue reading