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
相关推荐
饥饿的半导体15 分钟前
Linux快速入门
linux·运维
BD_Marathon25 分钟前
Ubuntu:Tomcat里面的catalina.sh
linux·ubuntu·tomcat
BD_Marathon26 分钟前
设置LInux环境变量的方法和区别_Ubuntu/Centos
linux·ubuntu·centos
Me4神秘29 分钟前
Linux国产与国外进度对垒
linux·服务器·安全
zhaowangji1 小时前
ubuntu 20.04 安装中文输入法 (sougou pin yin)
linux·ubuntu
两斤半1 小时前
Debian TTY环境乱码
linux·debian
还是奇怪2 小时前
Linux - 安全排查 2
linux·运维·安全
牛奶咖啡133 小时前
Linux系统的常用操作命令——文件远程传输、文件编辑、软件安装的四种方式
运维·服务器·软件安装·linux云计算·scp文件远程传输·vi文件编辑·设置yum的阿里云源
weixin_437398213 小时前
转Go学习笔记(2)进阶
服务器·笔记·后端·学习·架构·golang
难受啊马飞2.03 小时前
如何判断 AI 将优先自动化哪些任务?
运维·人工智能·ai·语言模型·程序员·大模型·大模型学习