Search code examples
rlinuxtidyversefedora

When attempting to install tidyverse in R studio on fedora tidyverse's dependencies wont install


Warning in install.packages :
  installation of package ‘googledrive’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘gargle’, ‘googledrive’, ‘httr’, ‘ids’ are not available for package ‘googlesheets4’
* removing ‘/home/lanewhitten/R/x86_64-redhat-linux-gnu-library/4.0/googlesheets4’
Warning in install.packages :
  installation of package ‘googlesheets4’ had non-zero exit status
ERROR: dependencies ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘rvest’ are not available for package ‘tidyverse’
* removing ‘/home/lanewhitten/R/x86_64-redhat-linux-gnu-library/4.0/tidyverse’
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

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

That is the tail of my error messages. Ive already installed curl on fedora using

sudo dnf install curl

I am at a total loss as to how to resolve this and switching operating systems or running a virtual machine is not an option for me.


Solution

  • This will make your R experience on Fedora much easier

    Unfortunately, CRAN does not provide binaries for Linux. That is why, by default install.packages() will compile any package you install from source. Many packages require developer libraries to be installed on the system for compilation. The lack of these packages is why you got the error.

    Overall, compiling packages yourself is far from ideal. All packages will take a longer time to install. Especially when you do them infrequently, updates will take an eternity. Also, finding out which system developer packages to install alongside can be time consuming as well, particularly for beginners.

    Luckily, there is a COPR repository for Fedora that provides up-to-date binaries for all CRAN packages. All you have to do is run these few lines in the system terminal (not R console):

    sudo dnf install 'dnf-command(copr)'
    sudo dnf copr enable iucar/cran
    sudo dnf install R-CoprManager
    

    Afterwards install.packages() in R will install the desired packages through the system package manager. This also means that you will receive R package updates whenever you run dnf update or update the system with your desktop environments software management GUI.

    You can find further documentation about this on the CRAN website.