找回密码
 立即注册
搜索
热搜: 活动 交友
查看: 2938|回复: 0

CentOS7 yum安装报错“Could not resolve host: mirrorlist.centos.org; Name or service not known“之解决办法(换源)

[复制链接]

32

主题

0

回帖

116

积分

管理员

积分
116
发表于 2024-12-18 09:01:34 | 显示全部楼层 |阅读模式
一.一键更换脚本
  1. 一.
  2. 国内源
  3. bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)

  4. #推荐使用一
  5. 二.
  6. 国内
  7. bash <(curl -sSL https://linuxmirrors.cn/main.sh)
  8. 国内教育网
  9. bash <(curl -sSL https://linuxmirrors.cn/main.sh) --edu
  10. 海外地区
  11. bash <(curl -sSL https://linuxmirrors.cn/main.sh) --abroad
复制代码

二.手动更换
CentOS7更换镜像源
1、先安装wget
  1. yum install -y wget
复制代码

2、打开阿里镜像http://mirrors.aliyun.com/
点击,帮助,查看详情:
3、下载CentOS 7的对应的repo文件
  1. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
复制代码

#或者
  1. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
复制代码

4、更新镜像源
  1. yum clean all

  2. yum makecache

  3. yum -y update
复制代码

执行完上面三行命令就好了
回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【赶紧来试试吧】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|奥多也网络 ( 粤ICP备2020119241号 )

GMT+8, 2025-12-9 04:44 , Processed in 0.067314 second(s), 26 queries .

Powered by AODUOYE

©2017-2026

快速回复 返回顶部 返回列表