日日噜噜夜夜狠狠久久丁香五月,人人摸人人操,人人妻人人,添人人爽,欧美一区,色婷婷综合缴情综,欧美午夜精品久久久久久浪潮

<>
文檔首頁> Linux> CentOS更換yum源

CentOS更換yum源

發(fā)布時間:2022-11-04 12:02        更新時間:2024-12-15 17:18

centos系統(tǒng)更換源

 

1.備份原始yum源

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

 

2.下載yum文件,替代原始yum源(這里替換aliyun源)

CentOS 6系統(tǒng)命令

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

如果wget命令不生效,說明還沒有安裝wget工具,或者使用

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

 

CentOS 7系統(tǒng)命令

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

或者

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

 

CentOS 8系統(tǒng)命令

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

或者

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

 

3.yum clean all && yum makecache 清除并生成緩存,會把新下載CentOS-Base.repo源生效。

 

4.其它

非阿里云ECS用戶會出現(xiàn) Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影響使用。用戶也可自行修改相關配置: eg:

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

 

其它yum源下載地址:

騰訊源

   Centos5: http://mirrors.cloud.tencent.com/repo/centos5_base.repo

   Centos6: http://mirrors.cloud.tencent.com/repo/centos6_base.repo

   Centos7: http://mirrors.cloud.tencent.com/repo/centos7_base.repo

網(wǎng)易源

    Centos5: http://mirrors.163.com/.help/CentOS5-Base-163.repo

    Centos6: http://mirrors.163.com/.help/CentOS6-Base-163.repo

    Centos7: http://mirrors.163.com/.help/CentOS7-Base-163.repo

華為源

    Centos5:https://repo.huaweicloud.com/repository/conf/CentOS-5-reg.repo

    Centos6:https://repo.huaweicloud.com/repository/conf/CentOS-6-reg.repo

    Centos7:https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo

 

注意:安裝時可能出現(xiàn)的錯誤

-bash: wget: command not found

解決辦法:

# 執(zhí)行如下命令

yum install -y wget