当前位置: 首页 > 工具软件 > glances > 使用案例 >

centos安装glances报错

邹英发
2023-12-01

一 问题重现

在安装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阿里云官方镜像安装步骤传送门

 类似资料: