配置

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://blog.csdn.net/lqzixi/article/details/132237899

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_9903.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注