centos安装glances报错

本文档详细记录了在CentOS系统中安装glances时遇到的找不到软件包的问题及其解决过程。问题源于本地环境中未配置epel源。通过备份原有epel源,然后安装阿里云的epel镜像源,最终成功安装了glances。此案例强调了更新Centos-Base.repo和epel.repo镜像源的重要性,以避免软件安装时的困扰。

一 问题重现

在安装glances时提示报错,如下

[root@bff8617b4afc yum.repos.d]# yum install -y glances       
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package glances available.
Error: Nothing to do

找不到可用的glances软件包

二 原因分析

yum安装glances软件包,需要epel源。
根据报错提示,本地环境没有配置epel源。

三 解决步骤

如果原本存在旧的epel源,就要首先对原来的epel源备份。
如果不存在epel源,则可以跳过这一步骤。

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup

其次安装官方阿里云的epel镜像源。
(此处以centos6为例)

[root@bff8617b4afc yum.repos.d]# curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-archive-6.repo

最后再次尝试安装glances,发现安装成功。

Installed:
  glances.noarch 0:1.7.4-1.el6                                                                                                       

Dependency Installed:
  python-psutil.x86_64 0:0.6.1-1.el6                            python-setuptools.noarch 0:0.6.10-4.el6_9                           

Complete!

由此发现,centos系统的Centos-Base.repo和epel.repo都是需要更新的,否则在安装软件时可能会出现很多麻烦。

Centos-Base.repo镜像源的更新文章传送门

epel.repo阿里云官方镜像安装步骤传送门

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值