Problem to install kableExtra on ubuntu 20

Hi! I just want to install this package, but I don't understand how to fix the problem.
Any ideas? :confused:

> install.packages("kableExtra")
Installing package into ‘/home/edugam/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘systemfonts’, ‘svglite’

probando la URL 'https://cloud.r-project.org/src/contrib/systemfonts_1.0.1.tar.gz'
Content type 'application/x-gzip' length 80368 bytes (78 KB)
==================================================
downloaded 78 KB

probando la URL 'https://cloud.r-project.org/src/contrib/svglite_2.0.0.tar.gz'
Content type 'application/x-gzip' length 122260 bytes (119 KB)
==================================================
downloaded 119 KB

probando la URL 'https://cloud.r-project.org/src/contrib/kableExtra_1.3.4.tar.gz'
Content type 'application/x-gzip' length 1646490 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* 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] ---------------------------
<stdin>:1:10: fatal error: fontconfig/fontconfig.h: No existe el archivo o el directorio
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/home/edugam/R/x86_64-pc-linux-gnu-library/4.0/systemfonts’
Warning in install.packages :
  installation of package ‘systemfonts’ had non-zero exit status
ERROR: dependency ‘systemfonts’ is not available for package ‘svglite’
* removing ‘/home/edugam/R/x86_64-pc-linux-gnu-library/4.0/svglite’
Warning in install.packages :
  installation of package ‘svglite’ had non-zero exit status
ERROR: dependency ‘svglite’ is not available for package ‘kableExtra’
* removing ‘/home/edugam/R/x86_64-pc-linux-gnu-library/4.0/kableExtra’
Warning in install.packages :
  installation of package ‘kableExtra’ had non-zero exit status

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

Thanks!!

You are missing a system dependency, install it from a terminal

sudo apt install libfontconfig1-dev
3 Likes

It worked! thank you :smiley:

This topic was automatically closed 7 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.