CentOS8 AnolisOS8 yum安装 No match for argument: htop Error: Unable to find a match: htop

  • CentOS8 AnolisOS8 yum安装 No match for argument: htop Error: Unable to find a match: htop已关闭评论
  • 378 次浏览
  • A+
所属分类:linux技术
摘要

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站今天有人反馈服务器卡,登录上服务器,想看下CPU以及内存使用情况,觉得top看不太清晰,想使用htop,发现没有,就想安装一个htop,输入命令,yum安装

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

CentOS8 AnolisOS8 yum安装失败

今天有人反馈服务器卡,登录上服务器,想看下CPU以及内存使用情况,觉得top看不太清晰,想使用htop,发现没有,就想安装一个htop,输入命令,yum安装

yum install htop 

没想到,返回了错误信息!

Repository epel is listed more than once in the configuration Last metadata expiration check: 0:00:07 ago on Thu 24 Mar 2022 03:54:06 PM CST. No match for argument: htop Error: Unable to find a match: htop 

CentOS8 AnolisOS8 yum安装 No match for argument: htop Error: Unable to find a match: htop

百度查了下,有人说要先清空缓存

yum clean all 

复制到服务器上执行后,还是一样不行,继续百度找解决方案。

安装失败原因

CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。

2021年12月31日CentOS 8 EOL。按照社区规则,CentOS 8的源地址
http://mirror.centos.org/centos/8/ 内容已移除,目前第三方的镜像站中均已移除CentOS 8的源。阿里云的源http://mirrors.cloud.aliyuncs.com 和http://mirrors.aliyun.com 也无法同步到CentOS 8的源。当您在阿里云上继续使用默认配置的CentOS 8的源会发生报错。

阿里云官方镜像主页

这边找到阿里云官方镜像网站

https://developer.aliyun.com/mirror/

找到CentOS,按照里面的操作步骤执行,依然失败!这边就不贴出来了,反正是错误的。

后面找到下面评论,有人给出了一个答案链接,有好几个点赞,就点进去试试看

https://help.aliyun.com/document_detail/405635.html

果然,成功了!

正确的操作步骤

rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo 
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo 
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo 
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g'  /etc/yum.repos.d/Centos-vault-8.5.2111.repo &&  sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo 
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo 
yum clean all && yum makecache 
yum install htop 

本文转自:https://blog.csdn.net/cyzshenzhen/article/details/123714134