在安装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都是需要更新的,否则在安装软件时可能会出现很多麻烦。