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.
Related
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.
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.
I am facing a particularly vexing problem with R package development. My own package, called ggstatsplot (https://github.com/IndrajeetPatil/ggstatsplot), depends on userfriendlyscience, which depends on another package called MBESS, which itself ultimately depends on another package called gsl. There is no problem at all for installation of ggstatsplot on a Windows machine (as assessed by AppVeyor continuous integration platform: https://ci.appveyor.com/project/IndrajeetPatil/ggstatsplot).
But whenever the package is to be installed on Unix machines, it throws the error that ggstatsplot can't be downloaded because userfriendlyscience and MBESS can't be downloaded because gsl can't be downloaded. The same thing is also revealed on Travis continuous integration platform with virtual Unix machines, where the package build fails (https://travis-ci.org/IndrajeetPatil/ggstatsplot).
Now one way to solve this problem for the user on the Unix machine is to configure GSL (as described here:
installing R gsl package on Mac), but I can't possibly expect every user of ggstatsplot to go through the arduous process of configuring GSL. I want them to just run install.packages("ggstatsplot") and be done with it.
So I would really appreciate if anyone can offer me any helpful advice as to how I can make my package user's life simpler by removing this problem at its source. Is there something I should include in the package itself that will take care of this on behalf of the user?
This may not have a satisfying solution via changes to your R package (I'm not sure either way). If the gsl package authors (which include a former R Core member) didn't configure it to avoid a pre-req installation of a linux package, there's probably a good reason not to.
But it may be some consolation that most R+Linux users understand that some R packages first require installing the underlying Linux libraries (eg, through apt or dnf/yum).
Primary Issue: making it easy for the users to install
Try to be super clear on the GitHub readme and the CRAN INSTALL file. The gsl package has decent CRAN directions. This leads to the following bash code:
sudo apt-get install libgsl0-dev
The best example of clear (linux pre-req package) documentation I've seen is from the curl and sf packages. sf's CRAN page lists only the human names of the 3 libraries, but the GitHub page provides the exact bash commands for three major distribution branches. The curl package does this very well too (eg, CRAN and GitHub). For example, it provides the following explanation and bash code:
Installation from source on Linux requires libcurl. On Debian or Ubuntu use libcurl4-openssl-dev:
sudo apt-get install -y libcurl-dev
Ideally your documentation would describe how do install the gsl linux package on multiple distributions.
Disclaimer: I've never developed a package that directly requires a Linux package, but I use them a lot. In case more examples would help, this doc includes a script I use to install stuff on new Ubuntu machines. Some commands were stated explicitly in the package documentation; some had little or no documentation, and required research.
edit 2018-04-07:
I encountered my new favorite example: the sys package uses a config file to produce the following message in the R console. While installing 100+ packages on a new computer, it was nice to see this direct message, and not have to track down the R package and the documentation about its dependencies.
On Debian/Ubuntu this package requires AppArmor.
Please run: sudo apt-get install libapparmor-dev
Another good one is pdftools, that also uses a config file (and is also developed by Jeroen Ooms).
Secondary Issue: installing on Travis
The userfriendly travis config file apparently installs a lot of binaries directly (including gsl), unlike the current ggstatsplot version.
Alternatively, I'm more familiar with telling travis to install the linux package, as demonstrated by curl's config file. As a bonus, this probably more closely replicates what typical users do on their own machines.
addons:
apt:
packages:
- libcurl4-openssl-dev
Follow up 2018-03-13 Indrajeet and I tweaked the travis file so it's working. Two sections were changed in the yaml file:
The libgsl0-dev entry was added under the packages section (similar to the libcurl4-openssl-dev entry above).
Packages were listed in the r_binary_packages section so they install as binaries. The build was timing out after 50 minutes, and now it's under 10 min. In this particular package, the r_binary_packages section was nested in the Linux part of the Travis matrix so it wouldn't interfere with his two OS X jobs on Travis.
usually I install R packages from CRAN mirrors, but some of them give me problems. This almost always happens with packages strongly interacting with the system (e.g. rgl, cairoDevices etc). If I well understood when I install packages from the Ubuntu repo with
apt-get install r-cran-rgl
these will be installed in /usr/lib/R/site-library directory. For a number of packages installed in /usr/lib/R/site-library when I do update.packages(ask=FALSE) from R (working under sys admin) I get the following type of messages:
Warning: package 'ggplot2' in library '/usr/lib/R/site-library' will not be updated
I presume that this happens because the version on the cran is newer than the one on the ubuntu repos. But, the rgl package is installed
in '/usr/lib/R/site-library', however when I invoke
update.packages(ask=FALSE)
R download and tries to install a new version of rgl although the one installed is the last one available on ubuntu repos. By the way it tries to install and it fails for some error.
Therefore, what I don't understand is why it doesn't try to update ggplot2 while it tries to update rgl when both have been installed via apt-get and both have the last release number appearing on the ubuntu repos.
Thanks
Pierre
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