!
也想出现在这里? 联系我们
广告位
当前位置:首页>教程分享>服务器教程>Linux提示网络不可达更换yun源教程

Linux提示网络不可达更换yun源教程

宝塔官方解决办法

1、备份原来的yum源,

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

centos7:

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

centos8:

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

更换后执行:

yum  clean  all

清除原来的yum源缓存
然后执行

yum makecache

生成新的yum源缓存

阿里云方法

配置方法

1. 备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

CentOS 6

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

或者

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

CentOS 7

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

或者

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

CentOS 8

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

或者

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

3. 运行 \'yum makecache \'生成缓存

4. 其他

非阿里云ECS用户会出现 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

给TA打赏
共{{data.count}}人
人已打赏
服务器教程

无法打开运行空间池服务器管理器WinRM插件可能已损坏或丢失

2021-4-17 18:28:24

服务器教程

百度提示您:该页面可能因黑客侵入而存在安全风险

2021-4-17 18:28:27

声明 本站上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。无意侵害您的权益,请发送邮件至 [email protected] 或点击右侧 私信:吉吉国王 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
OneEase