Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The program evince complains that it can't find libfreetype.so.6; however I clearly have the file and its included in my LD_LIBRARY_PATH; furthermore I have another program which uses libfreetype6 and is able to run just fine. What's going on here?

jbud@jb-pc ~> evince
evince: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory

jbud@jb-pc ~> ldd /usr/bin/evince | grep freetype
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x00007f912179d000)

jbud@jb-pc ~> file /usr/local/lib/libfreetype.so.6
/usr/local/lib/libfreetype.so.6: symbolic link to `libfreetype.so.6.11.1'

jbud@jb-pc ~> file /usr/local/lib/libfreetype.so.6.11.1
/usr/local/lib/libfreetype.so.6.11.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x21a4b8005e0c9a42af001b35fb984f4e25efc71c, not stripped

jbud@jb-pc ~> echo $LD_LIBRARY_PATH
/usr/lib/:/usr/lib64/:/usr/lib/x86_64-linux-gnu/:/usr/local/lib/

jbud@jb-pc ~> ldd jdrive/jstuff/work/personal/noengine/client | grep freetype
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x00007feb5ac89000)
share|improve this question

2 Answers 2

I was able to fix this problem however I'm still not entirely sure why this was a problem in the first place.

After running strace, I saw open("/usr/local/lib/libfreetype.so.6", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied) which doesn't quite make sense since other programs (without sudo powers) which depended on libfreetype were able to run, and the permissions are set for read/write for all, also running evince under sudo didn't help either.

My apt-get of libfreetype placed the library in /usr/lib/x86_64-linux-gnu/libfreetype.so.6 but for some reason evince wasn't checking that folder (even though it was added to LD_LIBRARY_PATH). However I created a symbolic link to a folder which it does check sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so.6.10.1 /usr/lib/libfreetype.so.6 and now evince runs fine.

share|improve this answer

Just for clarification: creating a symbolic link to /usr/lib/libfreetype.so.6 should not be applied if the error was thrown by a 32-bit application on a 64-bit Linux distribution. The library could be left 'broken'.

What you want on a 64-bit system is to install the necessary 32-bit dependencies around your 32-bit application, so that it will be able to detect and use the already existing libfreetype.so.6. This differs per application, but commonly missing are these:

sudo apt-get install libgtk2.0-0:i386 libidn11:i386 libglu1-mesa:i386

And these may possibly fix the problem too:

sudo apt-get install libpangox-1.0-0:i386 libpangoxft-1.0-0:i386

Regards, Albert Kok

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.