Installing Microsoft TrueType fonts on RHEL5, Step by Step

I'm doing some experimentation with JpGraph on Red Hat Enterprise Linux 5.5. So I wanted to install some TrueType fonts. Here's a step-by-step of how I did it, following the superb instructions given here.

Installed the rpm-build utility.

# yum install rpm-build

Then installed the cabextract utility, available on EPEL.

# yum install cabextract

Downloaded the latest spec file for msttcorefonts:

curl -O

Created a ~/.rpmmacros file containing one line:

%_topdir %(echo $HOME)/rpmbuild

Then I followed the instructions to create necessary directories:

$ mkdir -p ~/rpmbuild/BUILD
$ mkdir -p ~/rpmbuild/RPMS/noarch

Built the rpm:

$ rpmbuild -bb msttcorefonts-2.0-1.spec

For me, it stopped once during the build with a 500 error from Sourceforge:

Connecting to||:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2010-04-12 13:26:10 ERROR 500: Internal Server Error.

error: Bad exit status from /var/tmp/rpm-tmp.51326 (%prep)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.51326 (%prep)

I simply ran the previous command again and it worked.

Installed the rpm as root:

# rpm -ivh /home/john/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

I now see that the fonts are in /usr/share/

# find /usr -name *ttf -print


Reference: An easy way to install Microsoft's TrueType core fonts on linux



There is a error in your tutorial.

where you read:

rpmbuild -bb msttcorefonts-2.0-1.noarch.rpm

should be:

rpmbuild -bb msttcorefonts-2.0-1.spec


Not quite,
you left noarch there: rpmbuild -bb msttcorefonts-2.0-1.noarch.spec => rpmbuild -bb msttcorefonts-2.0-1.spec

Fixed. For real.

Thank you John,
Helpful and to the point.
Note that the version has been updated to 2.5.
Script-wise, all that is required is to change the minor number to a 5.

The utility cabextract is no longer available via yum. What is another way to download it and get it installed?

For those running Ubuntu, a much simpler way to do this is simply to copy Ubuntu's /usr/share/fonts/truetype directory to your Centos server.