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
相关推荐
苍狗T1 小时前
k8s 控制器管理
linux·运维·云原生·容器·kubernetes
Linux运维技术栈1 小时前
筑牢业务信息安全防线:雷池WAF+后端日志溯源的全链路防护体系落地实践
linux·安全·雷池
笨笨饿1 小时前
#121_图传中的H.364编码与MP4的联系
linux·运维·前端·单片机·嵌入式硬件·面试·职场和发展
运维糕手1 小时前
一次 EVS"disk doesn't exist"报错的完整排查:我差点删掉生产Kafka
运维
优化Henry1 小时前
5G站点BBU功能模块集成化与偶发案例
运维·网络·学习·5g·tdd
Tanner_SL1 小时前
Linux笔记之GIT常用命令
linux·git
小尘要自信2 小时前
软件远控失效以后怎么办?玩客云 + One-KVM 实现 BIOS 级远程画面与键鼠控制
服务器·网络·数据库
GeW2 小时前
RHCE通关"捷径":实战经验+应试技巧双管齐下
linux
小HANN2 小时前
高可用架构实战:Keepalived+LVS(DR)+MariaDB主主集群搭建指南
linux·运维·服务器·经验分享
不会就选b2 小时前
Linux之线程池(三)
linux·开发语言