Error and warning messages when installing devtools

I got this message when installing devtools in RStudio installed in Ubuntu 20.04. The package can not be loaded.

Installing 'devtools' ...
[1/2] Installing pkgdown...
Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘systemfonts’, ‘textshaping’, ‘ragg’

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

downloaded 79 KB

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

downloaded 34 KB

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

downloaded 414 KB

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

downloaded 850 KB

  • installing source package ‘systemfonts’ ...
    ** package ‘systemfonts’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Using PKG_CFLAGS=
    Using PKG_LIBS=-lfontconfig -lfreetype
    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
    --------------------------- [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/R/x86_64-pc-linux-gnu-library/4.2/systemfonts’
    ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/textshaping’
    ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/ragg’
    [2/2] Installing devtools...
    ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/pkgdown’

The downloaded source packages are in
‘/tmp/RtmpJLiWUK/downloaded_packages’
Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘systemfonts’, ‘textshaping’, ‘ragg’, ‘pkgdown’

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

downloaded 79 KB

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

downloaded 34 KB

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

downloaded 414 KB

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

downloaded 850 KB

trying URL 'https://cloud.r-project.org/src/contrib/devtools_2.4.4.tar.gz'
Content type 'application/x-gzip' length 374492 bytes (365 KB)

downloaded 365 KB

Using PKG_CFLAGS=
Using PKG_LIBS=-lfontconfig -lfreetype

  • 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
    --------------------------- [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/R/x86_64-pc-linux-gnu-library/4.2/systemfonts’
    ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/textshaping’
    ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/ragg’
    ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/pkgdown’
    ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/devtools’

The downloaded source packages are in
‘/tmp/RtmpJLiWUK/downloaded_packages’

:heavy_check_mark: Package 'devtools' successfully installed.
Warning messages:
1: In utils::install.packages("pkgdown", repos = "https://cloud.r-project.org") :
installation of package ‘systemfonts’ had non-zero exit status
2: In utils::install.packages("pkgdown", repos = "https://cloud.r-project.org") :
installation of package ‘textshaping’ had non-zero exit status
3: In utils::install.packages("pkgdown", repos = "https://cloud.r-project.org") :
installation of package ‘ragg’ had non-zero exit status
4: In utils::install.packages("pkgdown", repos = "https://cloud.r-project.org") :
installation of package ‘pkgdown’ had non-zero exit status
5: In utils::install.packages("devtools", repos = "https://cloud.r-project.org") :
installation of package ‘systemfonts’ had non-zero exit status
6: In utils::install.packages("devtools", repos = "https://cloud.r-project.org") :
installation of package ‘textshaping’ had non-zero exit status
7: In utils::install.packages("devtools", repos = "https://cloud.r-project.org") :
installation of package ‘ragg’ had non-zero exit status
8: In utils::install.packages("devtools", repos = "https://cloud.r-project.org") :
installation of package ‘pkgdown’ had non-zero exit status
9: In utils::install.packages("devtools", repos = "https://cloud.r-project.org") :
installation of package ‘devtools’ had non-zero exit status

1 Like

The error message is already giving you the solution, just install the appropriate system library for your operating system. Since you are using Ubuntu, in a system terminal run:

sudo apt install libfontconfig1-dev
1 Like

@andresrcs
I did, then restart R, and found this message in the console
Error in .rs.parsePackageDependencies(contents, extension) :
object 'partition_yaml_front_matter' not found.
what should I do to solve it?

Then, re-installed devtools, and got this error and warning message

install.packages("devtools")
Installing package into ‘/home/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘textshaping’, ‘ragg’, ‘pkgdown’

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

downloaded 34 KB

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

downloaded 414 KB

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

downloaded 850 KB

trying URL 'https://cloud.r-project.org/src/contrib/devtools_2.4.4.tar.gz'
Content type 'application/x-gzip' length 374492 bytes (365 KB)

downloaded 365 KB

  • installing source package ‘textshaping’ ...
    ** package ‘textshaping’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Package harfbuzz was not found in the pkg-config search path.
    Perhaps you should add the directory containing harfbuzz.pc' to the PKG_CONFIG_PATH environment variable No package 'harfbuzz' found Package fribidi was not found in the pkg-config search path. Perhaps you should add the directory containing fribidi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'fribidi' found
    Using PKG_CFLAGS=
    Using PKG_LIBS=-lfreetype -lharfbuzz -lfribidi -lpng
    --------------------------- [ANTICONF] --------------------------------
    Configuration failed to find the harfbuzz freetype2 fribidi library. Try installing:
  • deb: libharfbuzz-dev libfribidi-dev (Debian, Ubuntu, etc)
  • rpm: harfbuzz-devel fribidi-devel (Fedora, EPEL)
  • csw: libharfbuzz_dev libfribidi_dev (Solaris)
  • brew: harfbuzz fribidi (OSX)
    If harfbuzz freetype2 fribidi is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a harfbuzz freetype2 fribidi.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: hb-ft.h: No such file or directory
    compilation terminated.

ERROR: configuration failed for package ‘textshaping’

  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/textshaping’
    Warning in install.packages :
    installation of package ‘textshaping’ had non-zero exit status
    ERROR: dependency ‘textshaping’ is not available for package ‘ragg’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/ragg’
    Warning in install.packages :
    installation of package ‘ragg’ had non-zero exit status
    ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/pkgdown’
    Warning in install.packages :
    installation of package ‘pkgdown’ had non-zero exit status
    ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’
  • removing ‘/home/R/x86_64-pc-linux-gnu-library/4.2/devtools’
    Warning in install.packages :
    installation of package ‘devtools’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpM2HyL8/downloaded_packages’

So, I ran this:
sudo apt install libharfbuzz-dev libfribidi-dev

and re-installed devtools. Solved now, but I still have the warning message above "Error in .rs.parsePackageDependencies(contents, extension) :
object 'partition_yaml_front_matter' not found." This message appeared when I declined upgrading RStudio.
Thanks!

This is a known issue, I think it is already solved on the latest RStudio version so if you update, you should get rid of that error message.

1 Like

Yes, it is solved! Thanks so much!

1 Like

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.