dependency ‘Cairo’ is not available for package ‘ComplexHeatmap’ on Ubuntu 20.04 LTS

Please what could be a reason for this error? I am trying to install the R package ComplexHeatmap but I keep getting the error message that the the dependency Cairo is not available. I have tried to install Cairo using the command sudo apt-get install libcairo2-dev but I still get the same error. Running the command sudo dpkg-query -l | grep libcairo2-dev also shows that the Cairo package is fully installed.

Below are the commands I have run and the respective outputs:

Installation of ComplexHeatmap

> BiocManager::install("ComplexHeatmap")
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:168: xlib-backend.o] Error 1
ERROR: compilation failed for package ‘Cairo’
* removing ‘/root/R/x86_64-pc-linux-gnu-library/4.1/Cairo’
ERROR: dependency ‘Cairo’ is not available for package ‘ComplexHeatmap’
* removing ‘/root/R/x86_64-pc-linux-gnu-library/4.1/ComplexHeatmap’
The downloaded source packages are in ‘/tmp/RtmpsD5M9H/downloaded_packages’
Warning messages:
1: In .inet_warning(msg) : installation of package ‘Cairo’ had non-zero exit status
2: In .inet_warning(msg) : installation of package ‘ComplexHeatmap’ had non-zero exit status

To install Cairo:

(base) power@power-SYS-7039A-I:~$ sudo apt-get install libcairo2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcairo2-dev is already the newest version (1.16.0-4ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

To verify the proper installation of Cairo:

(base) power@power-SYS-7039A-I:~$ sudo dpkg-query -l | grep libcairo2-dev
ii libcairo2-dev:amd64 1.16.0-4ubuntu1 amd64 Development files for the Cairo 2D graphics library

Thanks in advance for any help.

1

1 Answer

You are probably do not want to read the messages which are shown during compilation. The Cairo package also requires X11/Intrinsic.h from libxt-dev package.

For Ubuntu 20.04 LTS with R 4.1 use commands below to install needed build-dependencies:

sudo apt-get install libcairo2-dev libxt-dev

and then retry.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like