i cannot install devtools package [non zero exit status]

R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

downloaded 79 KB

probando la 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

probando la 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

probando la 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

probando la 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 ‘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 existe el archivo o el directorio
    compilation terminated.

ERROR: configuration failed for package ‘systemfonts’

  • removing ‘/home/kevin/R/x86_64-pc-linux-gnu-library/4.2/systemfonts’
    Warning in install.packages :
    installation of package ‘systemfonts’ had non-zero exit status
    ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
  • removing ‘/home/kevin/R/x86_64-pc-linux-gnu-library/4.2/textshaping’
    Warning in install.packages :
    installation of package ‘textshaping’ had non-zero exit status
    ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
  • removing ‘/home/kevin/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/kevin/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/kevin/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/RtmpjaHYVS/downloaded_packages’

You are missing a system dependency and the error message already gave you the solution, just install that library in your system.