查看: 18|回覆: 0

centos-stream-9 centos9 配置国内yum源 阿里云源

[複製鏈接]

2

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2010-5-3
發表於 2023-8-11 18:26:00 | 顯示全部樓層 |閲讀模式

源配置

tips:
yum配置文件路径

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

1.备份源配置 [Very Important!]
mv /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.backup

2.Clean Cache:

yum clean all
3.Backup the Old CentOS-Base.repo
If exist this file.
cd /etc/yum.repos.d/
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
4.Create the new CentOS-Base.repo file with vim or other editor , and save to the directory '/etc/yum.repos.d/'  fill with the following contents below:
    # 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

Press the “ESC” key and input “:wq” to save and quit vim, if you use vim.

阿里源配置, ok

5. 更新缓存 
  yum makecache && yum update

or, you can use the follow tow commands.

yum makecache

then

yum update

Waiting for the “Complete!” notice in your terminal.

6.Finished.



来源:https://www.cnblogs.com/thesungod/p/17884156.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部