Problema para instalar pkgdown no Linux

Oi pessoal, estou fazendo o curso de pacotes da Curso-R e da lista passada na aula ontem, o único pacote que não deu certo instalar no Linux foi o pkgdown.

Eu uso Debian GNU/Linux 11 (bullseye) e consegui fazer a instalação do r-base-dev e também do devtools via linha de comando (com sudo apt install).

Só que com sudo apt install r-cran-pkgdown eu tenho este retorno:

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package r-cran-pkgdown

E via RStudio, este é o fim do retorno para install.packages(“pkgdown”):

  • 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 such file or directory
    compilation terminated.

ERROR: configuration failed for package ‘systemfonts’

  • removing ‘/feminista/hsvab/R/x86_64-pc-linux-gnu-library/4.0/systemfonts’
    Warning in install.packages :
    installation of package ‘systemfonts’ had non-zero exit status
  • 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 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
    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 ‘/feminista/hsvab/R/x86_64-pc-linux-gnu-library/4.0/textshaping’
    Warning in install.packages :
    installation of package ‘textshaping’ had non-zero exit status
    ERROR: dependency ‘textshaping’ is not available for package ‘ragg’
  • removing ‘/feminista/hsvab/R/x86_64-pc-linux-gnu-library/4.0/ragg’
    Warning in install.packages :
    installation of package ‘ragg’ had non-zero exit status
    ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
  • removing ‘/feminista/hsvab/R/x86_64-pc-linux-gnu-library/4.0/pkgdown’
    Warning in install.packages :
    installation of package ‘pkgdown’ had non-zero exit status

Alguém tem alguma sugestão de caminho para eu tentar?

Tks!

hsvab, pela mensagem de erro, parece que você precisa instalar algumas libs no Linux antes de instalar o pkgdown:

sudo apt update
sudo apt upgrade
sudo apt install libfontconfig1-dev libharfbuzz-dev libfribidi-dev
1 curtida

update, upgrade e libs instaladas:

Mas ainda não deu certo instalar o pacote :frowning:
image

Oi Haydee!
Instalando com o install packages também gera esse erro?
install.packages("pkgdown")

Com install.packages("pkgdown") ainda dá o mesmo erro que indiquei lá em cima…
Caçando dicas no Stackoverflow tb - já atualizei e instalei uns 5 pacotes e nada ainda kkkk

Tenta instalar todas essas libs:

sudo apt install libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev

Referência: textshaping install error on linux RHEL 7.4 - hb-ft.h: No such file or directory · Issue #21 · r-lib/textshaping · GitHub

1 curtida

Depois dessa “bruxaria” deu certo!

2 curtidas