Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

 

001、centos8 中yum安装软件出现如下报错

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

 

002、系统

复制代码
[root@localhost test01]# hostnamectl        ## 系统
   Static hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 47ab431cf1c54a55ac168f9d37795125
           Boot ID: 46f1cb3d6ca1416b9c23a3a776f94408
    Virtualization: vmware
  Operating System: CentOS Linux 8
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-305.3.1.el8.x86_64
      Architecture: x86-64
复制代码

 

003、问题原因

centos8已经 停止维护

 

004、解决方法

a、进入yum仓库配置文件目录

[root@localhost test01]# cd /etc/yum.repos.d/        ## 进入yum仓库配置文件目录
[root@localhost yum.repos.d]# ls
CentOS-Linux-AppStream.repo          CentOS-Linux-FastTrack.repo
CentOS-Linux-BaseOS.repo             CentOS-Linux-HighAvailability.repo
CentOS-Linux-ContinuousRelease.repo  CentOS-Linux-Media.repo
CentOS-Linux-Debuginfo.repo          CentOS-Linux-Plus.repo
CentOS-Linux-Devel.repo              CentOS-Linux-PowerTools.repo
CentOS-Linux-Extras.repo             CentOS-Linux-Sources.repo

 

b、修改配置文件内容:

[root@localhost yum.repos.d]# sed -i 's/mirrorlist/#mirrorlist/g' CentOS-*   ## 注释掉 mirrorlist
[root@localhost yum.repos.d]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' CentOS-*
## 使baseurl生效,并修改域名

 

c、测试安装效果

[root@localhost yum.repos.d]# yum -y install httpd         ## 安装测试

 

问题解决。

 

posted @   小鲨鱼2018  阅读(129)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2023-04-04 R语言中绘图,将图例设置在绘图区域之外
2022-04-04 ubuntu中 putty连接出现 network error. connection refused
2022-04-04 ubuntu中安装gcc c++编译器
2022-04-04 Peer reports incompatible or unsupported protocol version.
2022-04-04 cache.h:40:18: fatal error: zlib.h: No such file or directory
2022-04-04 bash: git: command not found...
2022-04-04 linux 中实现每两列数据合并为一列数据
点击右上角即可分享
微信分享提示