Score:2

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

uz flag

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.

guiverc avatar
cn flag
What OS & release are you using? You mention 20.04 in the title, but then report your release as 14.04 via tag? Please clarify.
Score:3
zw flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.