Tidyverse in ubuntu fails to install

install.packages("tidyverse")
Installing package into ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)
also installing the dependencies ‘gargle’, ‘curl’, ‘systemfonts’, ‘textshaping’, ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘ragg’, ‘rvest’, ‘xml2’

trying URL 'https://cloud.r-project.org/src/contrib/gargle_1.5.2.tar.gz'
Content type 'application/x-gzip' length 627560 bytes (612 KB)

downloaded 612 KB

trying URL 'https://cloud.r-project.org/src/contrib/curl_5.2.1.tar.gz'
Content type 'application/x-gzip' length 716695 bytes (699 KB)

downloaded 699 KB

trying URL 'https://cloud.r-project.org/src/contrib/systemfonts_1.0.6.tar.gz'
Content type 'application/x-gzip' length 80844 bytes (78 KB)

downloaded 78 KB

trying URL 'https://cloud.r-project.org/src/contrib/textshaping_0.3.7.tar.gz'
Content type 'application/x-gzip' length 35100 bytes (34 KB)

downloaded 34 KB

trying URL 'https://cloud.r-project.org/src/contrib/googledrive_2.1.1.tar.gz'
Content type 'application/x-gzip' length 1609266 bytes (1.5 MB)

downloaded 1.5 MB

trying URL 'https://cloud.r-project.org/src/contrib/googlesheets4_1.1.1.tar.gz'
Content type 'application/x-gzip' length 232584 bytes (227 KB)

downloaded 227 KB

trying URL 'https://cloud.r-project.org/src/contrib/httr_1.4.7.tar.gz'
Content type 'application/x-gzip' length 118500 bytes (115 KB)

downloaded 115 KB

trying URL 'https://cloud.r-project.org/src/contrib/ragg_1.3.0.tar.gz'
Content type 'application/x-gzip' length 430242 bytes (420 KB)

downloaded 420 KB

trying URL 'https://cloud.r-project.org/src/contrib/rvest_1.0.4.tar.gz'
Content type 'application/x-gzip' length 115876 bytes (113 KB)

downloaded 113 KB

trying URL 'https://cloud.r-project.org/src/contrib/xml2_1.3.6.tar.gz'
Content type 'application/x-gzip' length 294715 bytes (287 KB)

downloaded 287 KB

trying URL 'https://cloud.r-project.org/src/contrib/tidyverse_2.0.0.tar.gz'
Content type 'application/x-gzip' length 704618 bytes (688 KB)

downloaded 688 KB

  • installing source package ‘curl’ ...
    ** package ‘curl’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Package libcurl was not found in the pkg-config search path.
    Perhaps you should add the directory containing libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing libcurl.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libcurl' found
    Using PKG_CFLAGS=
    Using PKG_LIBS=-lcurl
    --------------------------- [ANTICONF] --------------------------------
    Configuration failed because libcurl was not found. Try installing:
  • deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
  • rpm: libcurl-devel (Fedora, CentOS, RHEL)
    If libcurl is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a libcurl.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=...'
    -------------------------- [ERROR MESSAGE] ---------------------------
    :1:10: fatal error: curl/curl.h: No such file or directory
    compilation terminated.

ERROR: configuration failed for package ‘curl’

  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/curl’
    Warning in install.packages :
    installation of package ‘curl’ had non-zero exit status
  • installing source package ‘systemfonts’ ...
    ** package ‘systemfonts’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Package fontconfig was not found in the pkg-config search path.
    Perhaps you should add the directory containing fontconfig.pc' to the PKG_CONFIG_PATH environment variable No package 'fontconfig' found Package freetype2 was not found in the pkg-config search path. Perhaps you should add the directory containing freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Using PKG_CFLAGS=
    Using PKG_LIBS=-lfontconfig -lfreetype
    --------------------------- [ANTICONF] --------------------------------
    Configuration failed to find the fontconfig freetype2 library. Try installing:
  • deb: libfontconfig1-dev (Debian, Ubuntu, etc)
  • rpm: fontconfig-devel (Fedora, EPEL)
  • csw: fontconfig_dev (Solaris)
  • brew: freetype (OSX)
    If fontconfig freetype2 is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a fontconfig freetype2.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=...'
    -------------------------- [ERROR MESSAGE] ---------------------------
    :1:10: fatal error: fontconfig/fontconfig.h: No such file or directory
    compilation terminated.

ERROR: configuration failed for package ‘systemfonts’

  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/systemfonts’
    Warning in install.packages :
    installation of package ‘systemfonts’ had non-zero exit status
  • installing source package ‘xml2’ ...
    ** package ‘xml2’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Package libxml-2.0 was not found in the pkg-config search path.
    Perhaps you should add the directory containing libxml-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found Package libxml-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing libxml-2.0.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libxml-2.0' found
    Using PKG_CFLAGS=
    Using PKG_LIBS=-lxml2
    ------------------------- ANTICONF ERROR ---------------------------
    Configuration failed because libxml-2.0 was not found. Try installing:
  • deb: libxml2-dev (Debian, Ubuntu, etc)
  • rpm: libxml2-devel (Fedora, CentOS, RHEL)
  • csw: libxml2_dev (Solaris)
    If libxml-2.0 is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a libxml-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=...'

ERROR: configuration failed for package ‘xml2’

  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/xml2’
    Warning in install.packages :
    installation of package ‘xml2’ had non-zero exit status
    ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/textshaping’
    Warning in install.packages :
    installation of package ‘textshaping’ had non-zero exit status
    ERROR: dependency ‘curl’ is not available for package ‘httr’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/httr’
    Warning in install.packages :
    installation of package ‘httr’ had non-zero exit status
    ERROR: dependency ‘httr’ is not available for package ‘gargle’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/gargle’
    Warning in install.packages :
    installation of package ‘gargle’ had non-zero exit status
    ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/ragg’
    Warning in install.packages :
    installation of package ‘ragg’ had non-zero exit status
    ERROR: dependencies ‘httr’, ‘xml2’ are not available for package ‘rvest’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/rvest’
    Warning in install.packages :
    installation of package ‘rvest’ had non-zero exit status
    ERROR: dependencies ‘gargle’, ‘httr’ are not available for package ‘googledrive’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/googledrive’
    Warning in install.packages :
    installation of package ‘googledrive’ had non-zero exit status
    ERROR: dependencies ‘curl’, ‘gargle’, ‘googledrive’, ‘httr’ are not available for package ‘googlesheets4’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/googlesheets4’
    Warning in install.packages :
    installation of package ‘googlesheets4’ had non-zero exit status
    ERROR: dependencies ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘ragg’, ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’
  • removing ‘/home/radjaa/R/x86_64-pc-linux-gnu-library/4.3/tidyverse’
    Warning in install.packages :
    installation of package ‘tidyverse’ had non-zero exit status

Try installing libcurl.pc at system's level

sudo apt install libcurl.pc

I think the required package is libcurl4-openssl-dev. It looks like libxml2-dev is also needed.

Thanks. It was late when I posed that and I was beginning to think this morning that I got it wrong.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.