I’ve been using R with ggplot2 and other packages on my Linux CentOS 7 for a long time.
Today, all of a sudden, it stopped working.
When I call the png()
function in my script, it generates the following errrors:
Warning messages:
1: In png(heatmap_file) :
unable to load shared object '/usr/lib64/R/library/grDevices/libs//cairo.so':
/lib64/libcairo.so.2: undefined symbol: FT_Get_Var_Design_Coordinates
2: In png(heatmap_file) : failed to load cairo DLL
I tried to update the cairo package many times but nothing worked out so far.
What can I do?
Thanks!
2
Answers
I found a solution and I am going to share it with the community.
I am working on a Dell Latitude 3540 laptop running Linux CentOS 7 operating system (centos-release-7-3.1611.el7.centos.x86_64).
I ran
sudo yum -y update
and I understood there was a duplication issue regarding thefreetype
package, which was installed twice, and some other packages that were having conflicts.I then removed the old freetype package and the conflicting packages with this command:
Then I updated all the packages I manually removed:
This method worked out for me; I hope it might be helpful to someone.
Your version of cairo (
/lib64/libcairo.so.2
) depends on a function calledFT_Get_Var_Design_Coordinates
. This function should come from FreeType. However, your version oflibfreetype.so
seems to be older and does not have this symbol. So, either you explicitly installed an older version, or “something” comes with an older version of FreeType.I would look for files called
libfreetype.so
and check if they have the necessary symbolI’m on Debian testing and here I get (this means that my version of FreeType does have this symbol; you would get no output if the symbol is not available):
For you, based on the path to
libcairo.so
, I would expect something like/lib64/libfreetype.so
to be the path to check.