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.
If you have administrator privileges, creating a symbolic link to
gcc-5
may do the trick: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.
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.
I was able to solve the problem with the following command.