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 containingfontconfig.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 containingfontconfig.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’
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