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
相关推荐
林间码客1 小时前
从DevOps到DevSecOps:构建现代软件交付的基石与护城河
大数据·运维·devsecops·devops
李白你好1 小时前
Windows 离线 Linux 提权辅助查询工具
linux
Lust Dusk2 小时前
记一次Linux应急响应题目解析
linux·运维·服务器·网络·安全·网络安全
ShineWinsu3 小时前
对于Linux:五种IO模型以及非阻塞IO的详细解析
linux·c++·面试·io·阻塞·非阻塞·fcntl
千千寰宇3 小时前
[Linux/Ollama] Termux : 一款运行在 Android 平台上的开源终端模拟器与 Linux 环境应用、支持在手机上基于Ollama部署LLM
linux
凌肖战3 小时前
TCP网络通信中setsockopt()函数解决地址已占用问题
服务器·网络·tcp/ip
轻揉小乔 真新人3 小时前
使用memc-nginx和srcache-nginx模块构建高效透明的缓存机制
运维·nginx·缓存
Yan_chen6664 小时前
SSH(Secure Shell)安全外壳协议详解
运维·网络协议·ssh
隔窗听雨眠4 小时前
OceanBase旁路导入与自增主键冲突深度解析:原理、排查与解决方案
java·服务器·数据库
lingran__5 小时前
Linux 基础常用指令万字详解(上)|文件目录命令,结合底层原理剖析
linux·运维·服务器·后端·centos·linux基础指令