Cannot install any R package - r

I'm on Ubuntu 20.04. R version 4.0.2.
I've been using R for a long time and everything worked fine.
Today, when trying to install new packages i get this error:
** checking absolute paths in shared objects and dynamic libraries
readelf: symbol lookup error: readelf: undefined symbol: ctf_arc_bufopen, version LIBCTF_1.0
Error in system(paste("readelf -d", shQuote(l)), intern = TRUE) :
error in running command
I tried to delete and reinstall R and all the packages, but now the same thing happens also for packages that were previously installed. So i think that the problem is not caused by R itself.
I havent done any R update recently.

First of all, thank you very much Chris for hinting at the problem. It was actually ctf-suite related.
When doing grep libctf* it returned:
ii libctf0:amd64 2.35.1-1ubuntu1
amd64 Compact C Type Format library (runtime, BFD dependency)
So I tried:
sudo apt-get install libctf-nobfd0
and it actually solved the problem.
I managed to install all the needed packages.

Related

Error linking GSL when installing R package? Symbol not found: _gsl_integration_qags

I'm new to R and GSL.
I'm trying to install an R package from GitHub (I have MacOS Big Sur). I originally got the error 'gsl/gsl_vector.h' file not found, then I installed GSL using brew install gsl, which fixed that error.
Now, I am getting a different error:
Symbol not found: _gsl_integration_qags
Does anyone have any suggestions about what might be causing this and how to fix it?
I tried creating a symbolic link to gsl in /usr/local/lib in case R couldn't find gsl, but this didn't fix the error.

InstallationWarning: package 'XYZ' is in use and will not be installed: R

I am trying to install package SBCK from R build using Rscript build.R -c -v -i in windows command prompt following the steps given here. However, I ended up with package SBCK being not installed because of following error/warning InstallationWarning: package 'SBCK' is in use and will not be installed. I have no package with name SBCK installed on my system, so I do not understand why I am getting this warning message and thus not to be able to install the R package.
I know that similar question have been asked before here but solution there does not work in my case.
I am using R version 4.2.0 on Windows 10.
Once 'build.R' is run, "SBCK_0.5.0.tar.gz" is created in the 'SBCK-R' folder.
You can now install it via the package archive file option or pointing to that file in the install.packages command. I faced the same issue and this solved it.

R unable to load dplyr

I'm running from Ubuntu 16, using R version 3.4.1. I have dplyr installed and can load it when either I am running from RStudio or when I sudo into R from the terminal. However, if I run R without root permission, I cannot load dplyr due to the following error:
Error: package or namespace load failed for ‘dplyr’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '<user-directory>/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so':
<user-directory>/anaconda3/lib/R/bin/exec/../../lib/../.././libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by <user-directory>/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so)
(where above I've replaced the /home/MY_USER_NAME dir with <user-directory> for some mild anonymization). I've seen a couple posts that may be tangentially related, but none of those remedies worked for me.
I'm curious if the fix is something as simple as changing permissions or ownership of certain files, or if the issue is that the search for GLIBCXX_3.4.20 is directed into my anaconda3 directory (when not root?!)?
Thank you in advance for any insights!
Edit: This may be an issue from a more base level with my installation of R. Often I install packages using install.packages(...) within RStudio, but on occasion this results in an error that is overcome by installing with install.packages(...) after entering R as root. This was the case with both dplyr and Rcpp. I.e., the versions which I have just reinstalled were done so as
> sudo R
> install.packages( 'Rcpp', dependencies = T )
> install.packages( 'dplyr', dependencies = T )
Please make your question useful and understandable by stating how you installed these packages.
They come both from Ubuntu ie sudo apt-get install r-cran-dplyr will get a working version, and from CRAN ie install.r dplyr will too (here using my install.r from littler, use other wrappers to install.packages() at your leisure).
Sometimes your underlying libraries change so my first bet would be to simply reinstall Rcpp and then dplyr.
Your reference to /home suggests you installed from source, but as root. That is a bad idea. There a number of other questions answered here on the site about when/where/how apt-get may (or may not) be preferable so I don't need to repeat this.
Edit: In response to your edit:
Never ever do sudo R. You want to write to /usr/local/lib/R/site-library and for that you can 1.a) add yourself to the group owning that directory or 1.b) make it owned by your group if it is just you on that machine.
You could just do install.packages(c("Rcpp", "dplyr")) but you don't even need that as dplyr depends on Rcpp.
Why not use the prebuild package? Remove what you have (ie sudo R CMD REMOVE Rcpp and ditto for dplyr, then do sudo apt-get install r-cran-dplyr

R cmd check not locating texi2pdf on mac after R 3.1.3 upgrade

Does anyone have a link to clear instructions on how to install and configure the necessary latex packages to build R packages on a mac?
I have some scripts for building and checking R packages on a mac server. They seemed to work fine, but after upgrading to R 3.1.3, many of the packages started failing with
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, :
Running 'texi2dvi' on 'networkVignette.tex' failed.
Messages:
sh: /usr/local/bin/texi2dvi: No such file or directory
Calls: <Anonymous> -> texi2pdf -> texi2dvi
Execution halted
I found a thread which seemed to suggest I need a more recent version texinfo (5.2) than what is installed by default. And apparently I've I've got the wrong version installed in the wrong location?
which texi2pdf
/sw/bin/texi2pdf
texi2pdf --version
texi2pdf (GNU Texinfo 5.1) 5234
(same version is reported when running system('texi2pdf --version') in R )
This thread gives a link to a texinfo 5.2 source collection:
http://r.789695.n4.nabble.com/R-CMD-build-looking-for-texi2dvi-in-the-wrong-place-R-devel-td4701706.html
But I'm not familiar with installing executable from a tar.gz file on a mac. The R mac help pages I found suggest installing MacTex, which I tried but that didn't seem to help.
** Update: ** additional discussion of related problems on R-SIG-mac mailing list:
https://groups.google.com/forum/#!topic/r-sig-mac/xjyuFdl5Ezk
Update:
Here is where I'm currently at:
I removed my /sw directory to uninstall fink and all of its packages (couldn't figure out how to upgrade it)
installed homebrew
brew install texinfo installs version 5.2 the package,
but generates the message This formula is keg-only, which means it was not symlinked into /usr/local and actually installs in in /usr/local/Cellar/texinfo/5.2/bin which means it is not on the path and R won't find it.
manually symlink each of the texi2pdf, texi2dvi , etc as vincent suggests (this is because R has the /usr/local/bin location as default in the tools::texi2dvi function?
edited the /etc/paths file on the system to add /usr/local/bin so that finds the brew installed 5.2 version before it finds it before the osx system supplied version 4.6 version. This may not be necessary because R has it hardcoded?
All of this gets rid of the "can't find texi* errors", and gives me a bunch of latex errors (which I don't see on unix and windows builds) so I'm still kind of stuck.
This seems very hackish, so there must be a cleaner way? But it sounds like stuff with tex and mac is very sketchy at the moment? https://tex.stackexchange.com/questions/208181/why-did-my-tex-related-gui-program-stop-working-in-mac-os-x-yosemite
This worked for me on Mavericks and on Yosemite:
ln -s /usr/bin/texi2dvi /usr/local/bin/texi2dvi
ln -s /usr/bin/texi2pdf /usr/local/bin/texi2pdf
On my Lion system both the command which texi2pdf at a Terminal/bash prompt and from a R.app GUI prompt tell me that I have that program in:
system("which texi2pdf")
#/opt/local/bin/texi2pdf
That is a location typical for MacPorts installation. I think the /usr/local/bin/ is what the binary R version "expects". I'm not really that UNIX savvy, but I think the you can modify the PATH environment variable so that R will be able to find your installation. (Whether it will be compatible I cannot say since so much detail is missing from your question.) My Tex installation is MacTex, which I got from https://www.tug.org/mactex/. I admit to having a cobbled-together system:
system("echo $PATH")
# /opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin
That gets set at the beginning of an R session because this is the first line in my .Rprofile-(invisible)file:
Sys.setenv(PATH="/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin")
I think /sw/bin/ installations signify a fink install, which I have had very little success with. Simon Urbanek suggests not using any package installers, but then leaves the rest of us UNIX weenies very little in the way of worked examples of how to install that various external packages that underpin the many interesting and oh-so-useful R packages. So I feel your pain, but I'm not running for President.
So I suppose you could try this at your R console before again attempting one of the earlier unsuccessful installs:
Sys.setenv(PATH=paste( Sys.getenv()$PATH, # should be the character string of the $PATH
"/sw/bin/", sep=":")
)
Wish I could offer guarantees, but if it breaks the only guarantee is that you get to keep all the pieces.
I ran into a similar error message using Mavericks 10.9.5 (factory configured) and R 3.1.
It turns out that I didn't have pdfLaTex. I went to this page: http://tug.org/mactex/ and downloaded the MacTex installation package. It's big (>2GB) but after I installed it, my R package build problems went away.
Hope this might be helpful to anyone else who runs into this error message.

install packages error

Here is my annoying problem.When I am trying to install packages by:
install.packages("multicore")
I get the error:
error at if (nzchar(SHLIB_LIBADD)) SHLIB_LIBADD else character() : the length of parameter is zero
Here multicore is not the only package that I can not install.I have the same error for many other packages(but not all of the packages) such as Rcpp etc.
I am using debian jessie with R version 3.0.3 (2014-03-06) -- "Warm Puppy" .I have run into this problem for a while.And it is really annoying.Even if I use the R which compiled from the source code it still has the same problem.
Appreciate any suggestion!
Mixing package management is tricky and Debian tends to ignore it.
try instead
sudo apt-get install r-cran-multicore
which I found by going to Debian Packages and searching descriptions for multicore "GNU R"
You can check it is the package you want here.

Resources