首页 > 系统相关 >CentOS7执行yum命令遇到“Could not resolve host: mirrorlist.centos.org; 未知的错误”如何解决

CentOS7执行yum命令遇到“Could not resolve host: mirrorlist.centos.org; 未知的错误”如何解决

时间:2024-11-05 19:41:40浏览次数:3  
标签:resolve centos repository -- Could repo mirrorlist yum

Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
 
 
 One of the configured repositories failed (未知),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:
     1. Contact the upstream for the repository and get them to fix the problem.
     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).
     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...
     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:
 
            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>
 
     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:
 
            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
 
Cannot find a valid baseurl for repo: base/7/x86_64
————————————————

原因是国内网络不能访问外网。所以需要将mirrorlist.centos.org替换为国内可以访问的镜像源。

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

然后再清除yum缓存

yum clean all

然后重新生成缓存

yum makecache

 

原文地址:https://blog.csdn.net/tyxjolin/article/details/141724487
————————————————

 

标签:resolve,centos,repository,--,Could,repo,mirrorlist,yum
From: https://www.cnblogs.com/abel-he/p/18528680

相关文章

  • CentOS部署Kafka中间件
    CentOS部署Kafka中间件 1.环境及版本说明:系统版本:CentOSLinuxrelease7.6.1810(Core)Kafka版本:kafka_2.12-2.2.0JDK版本:1.8.0_2122.安装下载#wget下载安装包wgethttp://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.2.0/kafka_2.12-2.2.0.tgz#无法......
  • 基于centos7制作JDK镜像以及字体安装
    1、编辑DockerfileviDockerfileFROMcentos:7MAINTAINERjdk8WORKDIR/usr/local/ADDjdk-8u371-linux-x64.tar.gz/usr/local/RUNln-sf/usr/share/zoneinfo/Asia/Shanghai/etc/localtimeENVJAVA_HOME=/usr/local/jdk1.8.0_371ENVCLASSPATH=.:$JAVA_HOME/lib/dt......
  • CentOS 7 下安装部署.NET Core多版本环境
    文章目录一、前言1、什么时候需要配置多环境?2、环境信息二、部署过程1、SDK下载&安装基础依赖2、配置环境入口三、问题一、前言1、什么时候需要配置多环境?.NETCore作为.NET的开源版本,可以说是非常拥抱开源了,更新的力度也非常给力。却也从开源世界学了点坏东西,那......
  • 解决vite resolve alias的typescript报错
    报错如下: tsconfig.json配置如下:tsconfig.app.json需要添加一下配置:"compilerOptions":{"include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src"],"exclude":["no......
  • centos7安装telnet服务
    环境:OS:Centos71.安装Telnet服务要在CentOS6上使用Telnet,需要安装telnet-server包。使用以下命令进行安装:yuminstalltelnet-server[root@localhost~]#yum-yinstallxinetdtelnet-serverLoadedplugins:fastestmirror,refresh-packagekit,securitySettingupInstal......
  • centos7安装
    centos系统安装及初始配置一.centos安装(自己喜好)分区:/boot1024MBext4/boot/efi50MB/swap64GB/余下的容量ext4网络名称改为:node01右下角configure里网络连接勾选上AUTO二.换源1.备份原有yum源mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS......
  • centos7升级openssh
    环境:OS:Centos71.查看当前的ssh和ssl版本[root@localhost~]#ssh-VOpenSSH_7.4p1,OpenSSL1.0.2k-fips26Jan2017 2.下载最新的版本OpenSSH9.8:wgethttp://down.tag.gg/Openssh/rpm/el7/openssh-9.8/openssh-9.8p1-1.el7.x86_64.rpmwgethttp://down.tag.gg/Openssh......
  • centos6安装telnet服务
    环境:OS:Centos6.91.安装Telnet服务要在CentOS6上使用Telnet,需要安装telnet-server包。使用以下命令进行安装:yuminstalltelnet-server [root@localhost~]#yuminstalltelnet-serverLoadedplugins:fastestmirror,refresh-packagekit,securitySettingupInstallPro......
  • centos6停止服务后yum改用阿里云
    环境:OS:Centos6.9 1.进入到yum配置目录cd/etc/yum.repos.d 2.备份cpCentOS-Base.repoCentOS-Base.repo.bk 3.下载wget-OCentOS-Base.repohttps://mirrors.aliyun.com/repo/Centos-6.repo 问题1:因为Centos-6早就停止了更新维护,阿里云镜像网站将其仓库也换......
  • Dell 塔式t440 安装centos
    硬件介绍1个10核2个超线程数cpu、cpu型号为4210R、内存大小为32G、两块1T硬盘、一张软阵列卡S140安装过程点击查看安装过程1.开机按F2进入SystemSetup界面,进入SystemBiosSettings界面1.1.SystemBiosSettings->SATASettings->选择【ACHIMode】......