Monday, February 23, 2009

libttf.so.2 for package: nagios

This was the ominous error I got every time I tried to upgrade nagios from what CentOS 5 provides in its base repository (2.12) to the more recent 3.0.6 provided in RPMForge's repository. I couldn't figure out what was going on and the Internet was full of accounts of the error that magically vanished the next day.

I don't know what they all had done wrong but I finally figured out what I'd done wrong to deserve this error :). I'd made the mistake of installing the rpmforge-release package meant for CentOS 4 instead of CentOS 5. This meant I was trying to install the el4 version of the nagios-3.0.6 package which apparently had this dependency. Before encountering this problem, however, I'd switched to the CentOS 5 repository so I didn't make the connection until I decided to read every letter of a yum install report:
[root@services ~]# yum install nagios
Loading "priorities" plugin
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
* epel: mirror.hiwaay.net
* rpmforge: apt.sw.be
* base: mirror.trouble-free.net
* updates: centos.mirror.nac.net
* centosplus: centos.mirror.nac.net
* addons: mirror.nyi.net
* extras: centos.mirror.nac.net
0 packages excluded due to repository priority protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package nagios.i386 0:3.0.6-1.el4.rf set to be updated
--> Processing Dependency: libttf.so.2 for package: nagios
--> Finished Dependency Resolution
Error: Missing Dependency: libttf.so.2 is needed by package nagios
I then realized why this problem might've fixed itself the next day - the yum cache might've become stale enough to be rebuilt. At that time yum would realize the el4 repository no longer existed and would remove it from the cache and replace it with the information about the el5 repository. When running a yum install nagios against the el5 repository, we get much more pleasant output:
[root@services ~]# yum install nagios
Loading "priorities" plugin
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
* epel: mirror.hiwaay.net
* rpmforge: apt.sw.be
* base: mirror.trouble-free.net
* updates: centos.mirror.nac.net
* centosplus: centos.mirror.nac.net
* addons: mirror.nyi.net
* extras: centos.mirror.nac.net
0 packages excluded due to repository priority protections
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package nagios.i386 0:3.0.6-1.el5.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
nagios i386 3.0.6-1.el5.rf rpmforge 3.6 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 3.6 M
Is this ok [y/N]: y
The moral of the story? After changing anything in your yum repositories, make sure to run:
yum clean all
yum makecache

6 comments:

  1. Worked like a charm. Thanks!

    ReplyDelete
  2. JT, I'm glad you found it useful :)

    ReplyDelete
  3. hi, i tried a lot, but i'm getting the same error,

    plz help me

    ReplyDelete
  4. LIKITH, are you getting this error after installing rpmforge?

    ReplyDelete