This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to install dplyr on Fedora 35

Hello,

I installed R on Fedora 35 with Homebrew. And I had used given below command to install dplyr.

install.packages("dplyr")

Then, for some of the packages in the dependency, I got the following error message and dplyr was not installed.


  • installing source package ‘fansi’ ...

** package ‘fansi’ successfully unpacked and MD5 sums checked

** using staged installation

** libs

gcc-5 -I"/home/linuxbrew/.linuxbrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I/home/linuxbrew/.linuxbrew/opt/libtirpc/include/tirpc -I/home/linuxbrew/.linuxbrew/opt/gettext/include -I/home/linuxbrew/.linuxbrew/opt/readline/include -I/home/linuxbrew/.linuxbrew/opt/xz/include -I/home/linuxbrew/.linuxbrew/include -fvisibility=hidden -fpic -Wno-implicit-function-declaration -c assumptions.c -o assumptions.o /bin/bash: gcc-5: command not found

/home/linuxbrew/.linuxbrew/Cellar/r/4.1.2/lib/R/etc/Makeconf:168: recipe for target 'assumptions.o' failed make: *** [assumptions.o] Error 127

ERROR: compilation failed for package ‘fansi’

  • removing ‘/home/linuxbrew/.linuxbrew/lib/R/4.1/site-library/fansi’

gcc is installed.

$ gcc --version

gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ which gcc

/usr/bin/gcc

If you know how to deal with this, please let me know.

homebrew linux r fedora

If you have administrator privileges, creating a symbolic link to gcc-5 may do the trick:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-5

You may need to log out and back in. Keep in mind that this is not a permanent or proper solution.

Thank you for your advice, Mr. Mensur Dlakic.

I tried the following command, and it generally worked.

sudo ln -s /usr/bin/gcc /usr/bin/gcc-5

sudo ln -s /usr/bin/g++ /usr/bin/g++-5

However, I got two warning messages.


Warning messages:

1: In install.packages("dplyr", dependencies = TURE) :

installation of package 'RMySQL' had non-zero exit status

2: In install.packages("dplyr", dependencies = TURE) :

installation of package 'RPostgreSQL' had non-zero exit status


During the installation of 'RMySQL' & 'RPostgreSQL, I got an error message like the attached image.enter image description here

enter image description here

I was able to solve the problem with the following command.

brew intall mysql

sudo yum install postgresql-devel

1 answer

Use conda to set up your R environment (https://docs.anaconda.com/anaconda/user-guide/tasks/using-r-language/). It will save you a lot of troubles involving compilers and supporting libraries.

Log in to answer this question.