Guus Bosman

software engineering director


You are here

guusbosmannl

Installing GD on OpenBSD 4.0

Drupal uses GD, a library to manipulate images. The operating system of my webserver is OpenBSD, and I recently upgraded to OpenBSD 4.0. The upgrade went fine, except for GD: I couldn't upgrade it. I would always get the following error message: lib not found freetype.13.1.

It turns out that OpenBSD now comes with a new version of GD, which requires the freetype library. The only supported way to install that on OpenBSD is by installing xbase.tgz, the X-Windows libraries. I don't use X-Windows and it's not exactly a clean solution to install 10 MB of code to get a single library to work, but it helped. After a reboot of the server GD now works under OpenBSD 4.0.

Here's the error message I used to get:

pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/php5-gd-5.1.4-no_x11.tgz
Can't install ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/php5-gd-5.1.4-no_x11.tgz: lib not found freetype.13.1
Even by looking in the dependency tree:
gettext-0.14.5p1, jpeg-6bp3, expat-2.0.0, t1lib-5.1.0p0, php5-core-5.1.4p1, libiconv-1.9.2p3, png-1.2.12p0, libxml-2.6.26
Maybe it's in a dependent package, but not tagged with @lib ?
(check with pkg_info -K -L)
If you are still running 3.6 packages, update them.

Comments

If you like it a little cleaner, you can selectively extract the single library from the archive by using
ftp -xzf xbase.tgz -I

correction:

tar -xzf xbase.tar -I "target file"

Please be aware that this is not completely correct, it might work but you loose all the correct filerights.

You need to get the -p variable as well:
-p, --same-permissions, --preserve-permissions
ignore umask when extracting files (the default for root)

The right way is:
cd / && tar xzvphf xbaseXX.tgz

Do not forget to add the library paths:
ldconfig -m /usr/X11R6/lib

Recent comments

Recently read

Books I've recently read: