rhel 默认的 yum 依赖于 rhn,要注册收费才能 update,改用 centos 的源:
1 rpm -e yum* --nodeps 2 rpm -qa | grep yum | xargs rpm -e --nodeps 3 4 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm 5 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 6 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm 7 wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm 8 9 rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm 10 rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 11 rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
1 cd /etc/yum.repos.d 2 去这里 http://mirrors.163.com/.help/centos.html 下载最新的 CentOS-Base.repo 3 编辑文件,把文件里面的 $releasever 全部替换为版本号(即6)最后保存(:0,$s/$releasever/6/g)
1 yum clean all 2 yum makecache 3 yum install dstat ...