Unable to install rsvg package at Ubuntu 22.04 with librsvg2-dev already installed

949 Views Asked by At

I am getting the following error at an Ubuntu 22.04, when trying to install rsvg at Rstudio.

--------------------------- [ANTICONF] -------------------------------- Configuration failed to find the librsvg-2.0 library. Try installing:

  • deb: librsvg2-dev (Debian,Ubuntu, etc)
  • rpm: librsvg2-devel (Fedora, EPEL)
  • csw: librsvg_dev, sunx11_devel (Solaris)
  • brew: librsvg (OSX)

If librsvg-2.0 is already installed, check that 'pkg-config' is in your PATH and PKG_CONFIG_PATH contains a librsvg-2.0.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

This problem is similar to this post, but involving a different context/error message.

The point is:

  1. The library librsvg2-dev is already installed and updated;
  2. From here, I understood how to check this 'PKG_CONFIG_PATH'...
  • The pkg-config --libs librsvg-2.0 returns:

-lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo

Which I do not understand completely but sounds ok, as it does not return 'not fond' as in that post.

  • The which pkg-config returns

/usr/bin/pkg-config

I am not able to understand this part of the error message:

If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD

The R+RStudio is running with a conda environment. Maybe it is related to it. How to meet system dependencies when a conda environment is used? I understand the conda install x sudo apt-get issues, and I should opt for conda install librsvg2-dev when I have conda environments, but it returns

PackagesNotFoundError: The following packages are not available from current channels:

I made a search at anaconda page, and I have already installed at the conda environment:

conda install -c conda-forge r-rsvg
conda install -c conda-forge librsvg

Still without success in installing rsvg...

Perhaps the question is Ubuntu related... but not sure... How can I solve it? How must I proceed to

set INCLUDE_DIR and LIB_DIR manually

As the message appears incomplete?

Any help is appreciated.

0

There are 0 best solutions below