先安装epel源:
0.安装yum优先级插件
yum install yum-priorities
1.epel简介: https://fedoraproject.org/wiki/EPEL/zh-cn
rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
以上URL请按实际情况修改
2.查看是否安装成功
rpm -q epel-release
3.导入key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
4.修改/etc/yum.repos.d/epel.repo文件
在[epel]最后添加一条属性 priority=11
vi /etc/yum.repos.d/epel.repo
意思是yum先去官方源查,官方没有再去epel的源找
5.重建缓存
yum makecache
装了个epel的扩展后,执行yum就开始报错:
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
解决办法:编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉
#baseurl
mirrorlist
改成
baseurl
#mirrorlist
用yum安装nethogs:
[root@Discuz yum.repos.d]# yum -y install nethogs已加载插件:fastestmirror, priorities
设置安装进程
Loading mirror speeds from cached hostfile
解决依赖关系
--> 执行事务检查
---> Package nethogs.i686 0:0.8.0-1.el6 will be 安装
--> 完成依赖关系计算
依赖关系解决
=====================================================================================================================================
软件包 架构 版本 仓库 大小
=====================================================================================================================================
正在安装:
nethogs i686 0.8.0-1.el6 epel 28 k
事务概要
=====================================================================================================================================
Install 1 Package(s)
总下载量:28 k
Installed size: 50 k
下载软件包:
nethogs-0.8.0-1.el6.i686.rpm | 28 kB 00:00
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
abrt-addon-ccpp-1.1.13-4.el6.i686 has missing requires of yum-utils
rhn-check-1.0.0-38.el6.noarch has missing requires of yum-rhn-plugin >= ('0', '0.5.3', '30')
正在安装 : nethogs-0.8.0-1.el6.i686 1/1
Verifying : nethogs-0.8.0-1.el6.i686 1/1
已安装:
nethogs.i686 0:0.8.0-1.el6
完毕!