Centos6.6安装sysstat报错/etc/cron.d
为了使用sar和iostat监控工具,需要安装sysstat包,但遇到报错
1.用yum安装
[root@leader Packages]# yum install -y sysstat*
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Examining sysstat-9.0.4-27.el6.x86_64.rpm: sysstat-9.0.4-27.el6.x86_64
Marking sysstat-9.0.4-27.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package sysstat.x86_64 0:9.0.4-27.el6 will be installed
--> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-27.el6.x86_64
--> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-27.el6.x86_64
--> Finished Dependency Resolution
Error: Package: sysstat-9.0.4-27.el6.x86_64 (/sysstat-9.0.4-27.el6.x86_64)
Requires: /etc/cron.d
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
2.用rpm安装
[root@leader Packages]# rpm -ivh sysstat*
warning: sysstat-9.0.4-27.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
/etc/cron.d is needed by sysstat-9.0.4-27.el6.x86_64
原因:
这是由于yum初始化安装时,安装了旧版本的GPG keys造成的
解决方法:
(引入已安装的public key)
[root@leader Packages]# rpm --import /etc/pki/rpm-gpg/RPM*
再次安装rpm包时,后面加上--force --nodeps如
[root@leader Packages]# rpm -ivh sysstat* --force --nodeps
Preparing... ########################################### [100%]
1:sysstat ########################################### [100%]