Problemas para instalar programas

Ei gente… boa tarde!!! Então, tenho tido vários problemas para instalar pacotes no R. A versão que uso é a 4.0.5. Gostaria de pedir uma ajuda para saber se eu tenho algum problema de configuração e uma ajuda na instalação do seguinte pacote.

Tentei instalar o pacote kableExtra e o output foi o seguinte:

Installing package into ‘/home/ivana/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘systemfonts’, ‘svglite’

tentando a URL ‘https://cloud.r-project.org/src/contrib/systemfonts_1.0.2.tar.gz
Content type ‘application/x-gzip’ length 80693 bytes (78 KB)

downloaded 78 KB

tentando a 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

tentando a 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] ---------------------------
    :1:10: fatal error: fontconfig/fontconfig.h: Ficheiro ou pasta inexistente
    compilation terminated.

ERROR: configuration failed for package ‘systemfonts’

  • removing ‘/home/ivana/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/ivana/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/ivana/R/x86_64-pc-linux-gnu-library/4.0/kableExtra’
    Warning in install.packages :
    installation of package ‘kableExtra’ had non-zero exit status

Opa! Pelo erro, parece que está com algum problema ao tentar compilar o pacote.

Qual sistema operacional você está usando? Parece que é Linux, seria o Ubuntu? Se for, você pode tentar instalar uma dependência que o pacote precisa. Mas essa dependência não é um pacote no R, mas um pacote no próprio sistema operacional. Para isso, você precisa abrir o terminal e instalar:

sudo apt install libfontconfig1-dev

Em seguida, tente instalar novamente o pacote.

1 curtida

Ei Raphael… deu super certo!!! Fico muito feliz de poder contar com vcs por aqui!! Obrigada!!

1 curtida