当前位置: 首页 > news >正文

解决新安装CentOS 7系统mirrorlist.centos.org can‘t resolve问题

原因

mirrorlist.centos.org yum源用不了

解决办法就是

# cd /etc/yum.repos.d/
# mv CentOS-Base.repo CentOS-Base.repo_bak
# vim CentOS-Base.repo

CentOS系统操作

# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/*.repo_bak
# curl -o /etc/yum.repos.d/CentOS-Linux-BaseOS.repo http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/
# curl -o /etc/yum.repos.d/CentOS-Linux-AppStream.repo http://vault.centos.org/8.5.2111/AppStream/x86_64/os/
# curl -o /etc/yum.repos.d/CentOS-Linux-Extras.repo http://vault.centos.org/8.5.2111/extras/x86_64/os/

文本内容如下

大陆机器
[base]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7[updates]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7[extras]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
非大陆机器
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

刷新yum源

# yum clean all
# yum makecache
# yum update

http://www.mrgr.cn/news/80667.html

相关文章:

  • ASP.NET|日常开发中数据集合详解
  • 零基础入门Git,快速拉取项目
  • LearnOpenGL学习(高级OpenGL -> 高级GLSL,几何着色器)
  • 前端性能优化思路
  • vue3中自定义组件的双向绑定
  • 将 OCI GenAI API 转换成 OpenAI API 兼容 API
  • NLP-Huggingface基本使用方法
  • 网络攻与防
  • Javascript面试手撕常见题目(回顾一)
  • linux centos 7 安装 mongodb7
  • vue字母划分选择城市组件(国内国际)
  • docker(wsl)命令 帮助文档
  • 英飞源嵌入式面试题及参考答案
  • 蓝桥杯算法训练 黑色星期五
  • 人工智能在VR展览中扮演什么角色?
  • ios 混合开发应用白屏问题
  • configure错误:“C compiler cannot create executables“
  • java error(2)保存时间带时分秒,回显时分秒变成00:00:00
  • 高并发 - 2.线程池
  • 大模型系列4--开源大模型本地部署到微调(WIP)
  • ubuntu系统版本安装docker容器
  • Kubeadm+Containerd部署k8s(v1.28.2)集群(非高可用版)
  • windows11 24H2 CSOL 闪退问题解决办法
  • Java通过反射破坏单例模式
  • Compose IO
  • Linux介绍与安装CentOS 7操作系统