记一次阿里云ECS服务器centos6.5无法使用epel源的爬坑

说明:

提示:提示:这篇文章仅是记录自己成长路上的愚笨,不喜勿喷,同时也希望各路大神提出优秀的观点。谢谢!!


问题描述:

:今天生产上出现了阿里云ECS服务器内网流出带宽占用过高的问题。经过网上查询阿里官网给出了一篇博客,如下:

如何处理云服务器ECS内网流量增高问题?

里面介绍的是让安装nethogs工具,找出哪个应用占用带宽高,但是在ECS服务器上安装nethogs软件时,却报错epel源不可用!
题外:
epel源:官网是这样介绍的
Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL).
大意是:
EPEL (Extra Packages for Enterprise Linux,企业版Linux的额外软件包) 是Fedora小组维护的一个软件仓库项目,为RHEL/CentOS提供他们默认不提供的软件包。这个源兼容RHEL及像CentOS和Scientific Linux这样的衍生版本。

网上也找了好多教程,基本都是以失败告终。无奈找到epel官网,按照官网的教程来安装,本以为按照官网可以成功,但是,我以为的以为,还是失败了!
注意:在自己安装的centos7中按照官网的教程是能成功的,但是阿里云ECS服务器不可以!

无奈只能查找阿里云ECS服务器配置了!!
进入源目录

cd /etc/yum.repos.d
ll

查看列表
repos的列表
在安装之前只有2018年的那几个文件
打开epel.repo

vim epel.repo
  1 [epel]
  2 name=Extra Packages for Enterprise Linux 6 - $basearch
  3 baseurl=http://mirrors.cloud.aliyuncs.com/epel/6/$basearch
  4         http://mirrors.aliyun.com/epel/6/$basearch
  5 failovermethod=priority
  6 enabled=1
  7 gpgcheck=0
  8 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  9
 10 [epel-debuginfo]
 11 name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
 12 baseurl=http://mirrors.cloud.aliyuncs.com/epel/6/$basearch/debug
 13         http://mirrors.aliyun.com/epel/6/$basearch/debug
 14 failovermethod=priority
 15 enabled=0
 16 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 17 gpgcheck=0
 18
 19 [epel-source]
 20 name=Extra Packages for Enterprise Linux 6 - $basearch - Source
 21 baseurl=http://mirrors.cloud.aliyuncs.com/epel/6/SRPMS
 22         http://mirrors.aliyun.com/epel/6/SRPMS
 23 failovermethod=priority
 24 enabled=0
 25 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 26 gpgcheck=0

在这篇配置中有个baseurl,点进去发现这个仓库中已经没有rpm文件了,里面有个README文件,打开这个文件

ATTENTION
======================================
The contents of this directory have been moved to our archives available at:

http://archives.fedoraproject.org/pub/archive/epel/

If you are having troubles finding something there please stop by #epel on irc.freenode.net

意思就是,注意:这个目录下的文件已经被移动到http://archives.fedoraproject.org/pub/archive/epel/这个地址下了。
SO,问题找到了!!


解决方案:

  1. 确认阿里云ECS服务器Linux版本

以下所有命令均在root环境下操作的

cat /etc/redhat-release

Linux版本

  1. 下载epel的rpm安装包
    一定要注意版本,要下载CentOS 6版本所对应的epel 的版本(目前这个地址肯定可用)
wget http://archives.fedoraproject.org/pub/archive/epel/6/i386/epel-release-6-8.noarch.rpm
  1. 安装epel
rpm -ivh epel-release-6-8.noarch.rpm
  1. 替换epel.repo文件(这一步很重要,如果不替换的话,安装epel源下的程序依然会不成功!)
mv epel.repo epel.repo.bak
mv epel.repo.rpmnew epel.repo

也就是把第三步中安装rpm后产生的repo替换掉ECS服务器原带的repo!

  1. 验证epel源
yum repolist
Trying other mirror.
repo id                                  repo name                                                                        status
base                                     CentOS-6 - Base                                                                   6,713
epel                                     Extra Packages for Enterprise Linux 6 - x86_64                                   12,581
extras                                   CentOS-6 - Extras                                                                    47
updates                                  CentOS-6 - Updates                                                                1,169
repolist: 20,510

  1. 安装nethogs
yum install nethogs

经过漫长的等待,nethogs安装成功,大功告成!

大功告成!

安装过程没有记录截图,遗憾了。。。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值