Skip to content
Advertisement

R ERROR: dependencies ‘xml2’, ‘httr’ are not available for package (Linux Mint 20.1)

I did not quite know where this belongs exactly, so I decided to post this here on stack overflow.

I recently had package issues with R and R-Studio on Linux Mint 20.1, where I always recieved dependency errors when installing packages like plotly and tidyverse. Therefore, in order to test if my system was responsible I live booted a fresh Linux Mint USB and installed R and R-Studio the following way:

sudo apt update  
sudo apt dist-upgrade
sudo apt install r-base

Then download R-Studio from here and installed it like:

sudo apt-get install gdebi-core

# Install R-Studio with gdebi
sudo gdebi rstudio-1.2.5042-amd64.deb

Then, I opened RStudio by typing rstudio in the terminal. Inside RStudio I tried to install the package tidyverse by install.packages("tidyverse") which resulted in some dependency errors like:

ERROR: dependencies ‘xml2’, ‘httr’ are not available for package ‘rvest’
* removing ‘/home/mint/R/x86_64-pc-linux-gnu-library/3.6/rvest’
* installing *source* package ‘tibble’ ...

Advertisement

Answer

The solution was to use the command, suggested in the r-lib issue by @fredaas:

sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev

By using this command I was able to resolve the issue and install every package I required flawlessly.

I am sorry if this does not belong here but I hope I can help someone saving hours of troubleshooting. This issues is maybe caused by Linux Mint or the most recent R Version 4.0.3 so I was not sure where to share my results.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement