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
相关推荐
运维小杨3 分钟前
Docker的安装,服务器与客户端之间的通信
服务器·docker·容器
Swaggy T6 分钟前
自动驾驶控制算法——MPC控制算法
linux·人工智能·自动驾驶
希赛网1 小时前
希赛《华为 HCIA-Datacom 》核心考点之 NAT 技术解析
运维·服务器·网络·计算机网络·智能路由器·华为认证
机器视觉知识推荐、就业指导1 小时前
手动开发一个TCP服务器调试工具(二):无界面 TCP 通信服最小实现
服务器·网络协议·tcp/ip
胖大和尚4 小时前
ssh 公钥连接服务器失败,排查方向
运维·服务器·ssh
黄沐阳5 小时前
AP配置(leaderAP组网模式)
运维·网络·智能路由器
可变羽翼核心7 小时前
Steam饥荒联机版多人服务器搭建全解析 -- 阿里云Linux系统构建云服务器
linux·运维·服务器
我科绝伦(Huanhuan Zhou)9 小时前
DM8日常运维命令总结(四)
运维
是垚不是土9 小时前
JumpServer 堡垒机全流程搭建指南及常见问题解决方案
运维·安全·网络安全·github·系统安全·创业创新
yangrenrui9 小时前
GitLab:一站式 DevOps 平台的全方位解析
运维·gitlab·devops