Offline r-base installation on SLES12.3 - r

We need to install R-base version 3.5+ on an offline machine running SLES12.3
We have downloaded all the packages from the the SUSE r repo
http://download.opensuse.org/repositories/devel:/languages:/R:/released/openSUSE_12.3/x86_64/
while running zypper install on the packages there are additional dependencies that we are not able to find the relevant packages to download.
These include:
libtcl8.5.so()(64bit)
libgomp.so.l()(64bit)
But we are not able to find the dependency package that include these libraries.
What should be the correct approach for installing these libraries offline? where can we find these libraries?
Is there a better way for offline installing R-base ? we tried to follow the instructions on the cran rstudio page

The files you downloaded don't match the distribution you're running. SUSE Linux Enterprise (SLE) and openSUSE are similar in some ways, but these are really two separate distributions and you can not always mix binaries between the two. To install R on SLE Server 12.3, you should use the repository https://download.opensuse.org/repositories/devel:/languages:/R:/released/SLE_12/.
You can find out these URLs by looking at the right hand-side column at https://build.opensuse.org/project/show/devel:languages:R:released. Look for things called "SLE" there.

Install the Development Tools, according to this answer
zypper install --type pattern Basis-Devel
Download R source and install it
wget http://cran.univ-paris1.fr/src/base/R-3/R-3.5.0.tar.gz
tar zxf R-3.5.0.tar.gz
cd R-3.5.0
./configure --enable-R-shlib
make
make check
make install
Maybe there are still dependencies missing, which need to be installed with zypper (I don't have any Suse to try myself). With this method you have an "empty" R and you will install R packages one by one (with R CMD INSTALL). Maybe not the best answer for your need, but an answer.

Related

Installing a specific version of R from an Apt repository

R volunteers currently maintain Ubuntu package repositories for R ~3.5 and ~4.0. For Bionic Beaver, these are:
https://cloud.r-project.org/bin/linux/ubuntu/bionic-cran35/
https://cloud.r-project.org/bin/linux/ubuntu/bionic-cran40/
I am building separate Singularity containers, into which I need very specific versions of R installed; which appear to be provided in these repositories. Specifically, I'm looking to build containers containing R versions 3.6.1, 4.0.3 and 4.1.0; one container per version.
I do this, in the container build script, by first adding the appropriate Apt source, then running the install with a pinned version. I noticed that I could only get it to run if I use the precise version numbers listed in the package repository and also include r-recommended at the same version. For example, for R 3.6.1:
apt install -y r-base=3.6.1-3bionic r-recommended=3.6.1-3bionic
This correctly installs r-base and r-recommended at the given versions. However, when I run the containerised R, R is actually reporting itself to be at the latest version provided by those repositories (3.6.3, 4.1.0 and 4.1.0, respectively). Presumably, given r-base is correct, this may even suggest them to be in a broken state.
Looking through Apt's output, it's clear that many other r-* packages are defaulting to the latest versions, rather than the versions I specified. In an attempt to get around this, I tried explicitly setting the versions on all the packages that are defaulting to the latest version. For example, again with R 3.6.1:
apt install -y r-base=3.6.1-3bionic \
r-base-core=3.6.1-3bionic \
r-base-dev=3.6.1-3bionic \
r-base-html=3.6.1-3bionic \
r-doc-html=3.6.1-3bionic \
r-recommended=3.6.1-3bionic
However, this refuses to work, complaining about conflicts with other packages it's trying to install (r-cran-* packages, IIRC).
I don't know if this is an Apt-thing, an R-thing, or something to do with their repositories. Is there a way I can get these specific versions installed from the official sources, without having to build anything myself? (If not, what's the point of them keeping the older versions in their repositories?)
Thanks to #Chris' tip-off, the structure of said R packages is important to understand.
r-base is a metapackage which includes, amongst other things, r-base-core and r-recommended. r-recommended is another metapackage which includes a suite of recommended R packages, which introduce the incompatibility when trying to pin to versions.
For just the R binaries and the documentation, pinned to a specific ${VERSION}, this will do the trick:
apt install -y --no-install-recommends \
r-base-core=${VERSION} \
r-base-html=${VERSION} \
r-doc-html=${VERSION}
If you want to build packages, you'd also want r-base-dev=${VERSION} in there.

Unable to install the tidyverse

There is no package called 'tidyverse' is the error message I get after doing this:
install.packages('tidyverse', dependencies = T);
install.packages('DBI', dependencies = T);
library(DBI);
library(tidyverse);
I use Ubuntu 18.04 and Rstudio.
Could anyone sort me out here, please?
You may find this blog post and associated video useful -- it shows how to install all of tidyverse on Ubuntu directly from prebuilt binaries with one command.
In short, that is what PPAs are good for. The associate slides have the relevant commands.
And once you do the required step of adding the two PPAs and running sudo apt-get update (again, both detailed in the slides) then all it takes is a single sudo apt-get install r-cran-tidyverse as the video shows.
Added bonus: because you install binaries that pre-made it is the fastest possible installation.
Edit three years later: We now have r2u which thanks to its use of bspm plus its complete set of CRAN binaries lets you just use install.packages("tidyverse") to install all packages as binaries along with all dependencies in a matter of seconds as shown in a few gifs on the site, my blog, and elsewhere. Plus anybody can try it in the browser via gitpod from the r2u site.
The default setup in R on Linux is to compile packages from source since CRAN only provides binaries for macOS and Windows. This is not the recommended way to install packages on Ubuntu. As pointed out by #DirkEddelbuettel in his edit to his answer, you can use r2u and bspm to obtain binaries for all CRAN packages. This will require initial setup but result in a much better user experience. If you insist on compiling the tidyverse yourself, my old answer remains below.
Old answer
tidyverse has external dependencies that cannot be installed through R and that aren't preinstalled in Ubuntu. Install the following packages via the terminal:
sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev
Run install.packages("tidyverse") again after that.
You can find more help regarding this here.

"rgdal" installation failed on ubuntu

I use travis to check my R package, it's based on a virtual machine of ubuntu. One of my dependencies is rgdal from CRAN, which cannot be installed correctly on travis.
First it said:
ERROR: dependencies ‘rgdal’ is not available for package ‘my package’
I followed the instruction here, then comes the endless dependencies, I installed one by one, according to the instruction of every trial. Finally I installed packages is as below:
libproj-dev
libcurl4-gnutls-dev
libdap-dev
libgdal-dev
libgdal1h
libhdf5-dev
libhdf5-serial-dev
libgdal-dev
libgdal1-dev
It said I still need to install libhdf5-7 = 1.8.11-3ubuntu1~precise1~ppa1
But when I install package libhdf5-7 = 1.8.11-3ubuntu1~precise1~ppa1, it gives another error:
E: Unable to locate package
E: Unable to locate package 1.8.11-3ubuntu1~precise1~ppa1
E: Couldn't find any package by regex '1.8.11-3ubuntu1~precise1~ppa1'
And it seems no more solutions now.
I wonder how to fix this on travis? Is it a common issue on only travis virtual machine or it could happen on any ubuntu machine? Or the package rgdal has some problems with ubuntu?`
Background:
All my installation above used apt-packages of travis, which is explained as below by travis:
apt_packages: A list of packages to install via apt-get. Common examples here include entries in SystemRequirements. This option is ignored on non-linux builds
As of this week, you can opt into using Ubuntu 14.04 on Travis:
See this blog post from Travis for details
See this .travis.yml where I enable Trusty aka 14.04
Switching to 14.04 may be enough in this case. If not, also note that you can prepare your own .deb packages. I mention this in an blog post from this summer.
As the geospatial packages are a little involved that is probably your best. You would need to know how to build Debian packages, and how to use Launchpad to have them auto-built for you. Both topics have lots of tutorials.

OpenCPU how to install a package in R/pub?

I'm unclear about how to install an R package under R/pub in openCPU on my own openCPU server. The openCPU documentation states that package installation is handled by the administrator, but does not give any instructions (that I can find) concerning package installation.
I'm sure I'm missing something obvious but any help with this would be appreciated.
FWIW, I'm attempting to install the ''markdown'' package, which for some reason wasn't installed when calling opencpu-cran.
UPDATE:
I found this link to an example. It calls to the following URL "/Radmin/call/opencpu.demo/install.opencpu/json", but that approach appears not to work based on this SO question. So, if that's not the way to install packages via openCPU, how is it done?
The /R/pub endpoint contains all packages in public R libraries on the system. To install a package, you could ssh into the system, start R as root sudo -i R and then simply use install.packages to install the packages to the global library.
Alternatively, you can install one of the many r-cran-* packages which are available through the ubuntu repositories or cran2deb4ubuntu launchpad, e.g:
sudo apt-get install r-cran-xml

upgrade R 2.7.1 on Debian core procedure

My R version is 2.7.1 (on Debian) and some packages are asking for > 2.10. I cannot find updating instructions and I don't want to remove and reinstall as I have other things depending on R and I don't want to mess up. Is there an update procedure?
Closest thing to my problem is on this thread.
check out the instructions for installing from source. Its easy on a Linux box, and you can do the install in any directory you like, you dont even need superuser permissions. Once compiled you can even run R from that directory without messing up any system-installed R. As long as you give the full path to R's binary, or put the path to it in your PATH environment variable, when starting it it will work fine.
FYI
It seems that R on Debian with versions previous to 2.7.1 cannot be updated.
The current core runs from 2.7.1 up. The only way to do it is to remove the existing version.
As this was not straight forward I post it here. If you have Rapache or other things connecting to R disable them with dismode or related.
apt-get purge r-base r-base-dev
I had to do this as well
dpkg -P r-base-core
until this shows no more installed R packages
dpkg -l r-*
Then follow the instruction from http://cran.r-project.org/bin/linux/debian/, with the amendment that you should use deb instead of deb-src in /etc/apt/sources.list.
deb http://<favorite-cran-mirror>/bin/linux/debian lenny-cran/
Before installing run this and it should not say 2.7.1.
apt-cache policy r-base-dev

Resources