• 七云数据--高防低价服务器抢购
  • 黑猫导航网
  • 七云数据-海外/国内云服务器 黑猫导航网 网络验证系统 短信宝-精准短信营销服务平台 50/月文字广告位 50/月文字广告位 50/月文字广告位 50/月文字广告位

    centos更换yum源


    centos系统更换源

    1.备份原始yum源

    cd /etc/yum.repos.d

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

    2.下载yum文件,替代原始yum源

    CentOS 6

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

    CentOS 7

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

    CentOS 8

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

    3.yum clean all 清除缓存

    4.yum makecache 生成缓存

    其它yum源下载地址:

    腾讯源http://mirrors.cloud.tencent.com/repo/centos7_base.repo

    网易源http://mirrors.163.com/.help/CentOS7-Base-163.repo

    华为源https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo

    注意:安装时可能出现的错误

    -bash: wget: command not found

    解决办法:

    执行如下命令

    yum install -y wget


    推荐阅读:

    宝塔安装 出现404 使用一下命令换源即可解决!

    挂载磁盘教程

    评 论
    请登录后再评论