linux-centos8-安装make

参考:

CentOS 8中 更新或下载时报错:为仓库 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist_errors during downloading metadata for repository -CSDN博客

https://blog.csdn.net/lxcw_sir/article/details/140185068

Linux报错"-bash: make: command not found"-CSDN博客

https://blog.csdn.net/cnds123321/article/details/116138257


问题描述

新服务没装make,报错:bash: make: command not found

shell 复制代码
[root@localhost DNAWorks]# make
bash: make: command not found...
Failed to search for file: cannot update repo 'appstream': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]; Last error: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]

安装

使用命令:

shell 复制代码
yum -y install gcc automake autoconf libtool make

结果遇到报错:Error: Failed to download metadata for repo 'appstream'

shell 复制代码
[root@localhost DNAWorks]# yum -y install gcc automake autoconf libtool make
CentOS Linux 8 - AppStream                                 0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'appstream':
  - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]

这是因为 CentOS Linux 8已于 2021年12月31日停止更新和维护,由于CentOS 团队从官方镜像中移除CentOS 8的所有包,所以在使用yum源安装或更新会报上述失败错误。

解决方案:先进入仓库源文件夹下,然后修改镜像配置,清空缓存并重新生成,最后更新软件包,如下所示

shell 复制代码
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
yum clean all && yum makecache
yum update -y

然后重新执行上面的安装命令即可。

编译时,如果提示:make: gfortran: Command not found,则安装gfortran。

shell 复制代码
yum install gcc-gfortran
相关推荐
上海蓝色星球4 小时前
迈向智慧电网新纪元:上海蓝色星球数字孪生变电主子站系统
运维·数据库
南棱笑笑生5 小时前
20251217给飞凌OK3588-C开发板适配Rockchip原厂的Buildroot【linux-5.10】后调通ov5645【只能预览】
linux·c语言·开发语言·rockchip
爬山算法6 小时前
Netty(10)Netty的粘包和拆包问题是什么?如何解决它们?
服务器·网络·tcp/ip
Sleepy MargulisItG6 小时前
【Linux网络编程】应用层协议:HTTP协议
linux·服务器·网络·http
logic_56 小时前
静态路由配置
运维·服务器·网络
G31135422736 小时前
Linux 内核设计中的核心思想与架构原则
linux·架构·php
zhuzewennamoamtf6 小时前
Linux内核platform抽象、数据结构、内核匹配机制
linux·运维·数据结构
门思科技7 小时前
企业级 LoRaWAN 网关远程运维方案对比:VPN 与 NPS FRP 的技术与安全差异分析
运维·网络·安全
云和数据.ChenGuang7 小时前
Deepseek 持续迭代的模型
运维·运维技术·数据库运维工程师·运维教程
物联网软硬件开发-轨物科技7 小时前
【轨物方案】聚焦锯床设备智能化升级,打造工业互联网新范式
运维·科技·物联网