0

We have a ubuntu linux server in our office which is a air-gapped environment. There is no internet access to external network.

However I would like to install few R packages like ggplot2, Database Connector, dplyr, Tidyverse etc. I have more than 10-15 packages to download

While I cannot write the usual command install.packages("DatabaseConnector"), I have to download the zipped folders from CRAN as shown here.

I am new to R. So, can you help me with my questions given below?

a) Why is there are no files for linux systems? I only see windows binaries and macOS binaries. Which one should I download?

b) Should I download binaries or package source? which one is easy to install?

c) When I download packages like above as zipped file from CRAN like shown here, will the dependencies be automatically downloaded as well? Or should I look at error messages and keep downloading them one by one?

d) Since I work in a Air-gapped environment, what would be the best way to do this process efficiently.

The Great
  • 7,215
  • 7
  • 40
  • 128
  • This is definitely not the best solution, but might be suitable if you want to have access to several packages (or more precisely ALL of them) locally: https://stackoverflow.com/questions/39051381/how-to-download-the-entire-cran-repository – mhovd Jun 11 '21 at 07:38
  • If you want to install a huge meta package like the tidyverse you have way more packages to download than 10-15. Remember, you need to install the whole dependency tree for each package. – Roland Jun 11 '21 at 07:58
  • @Roland - Do you know which binary should I download? Or should I download source files? – The Great Jun 11 '21 at 08:09
  • Consider https://docs.rstudio.com/rspm/admin/appendix/airgapped-installs/ . RStudio Package Manager offers Ubuntu binaries, and plans for the air-gapped case – Aurèle Jun 11 '21 at 08:13

1 Answers1

1

Under linux packages are always installed from source. There are no official binary packages for linux. However, your distro might offer some of them in the official repositories. Ubuntu does. However these tend to be quite old versions and usually limited to a handfull of the most important packages. So, for linux you have to download the source packages. The zip files are for windows and will not work.

You will also need to download all of the dependencies of the packages. For something like tidyverse this will be a huge number. Tracking those by hand is a lot of work. Easiest is probably to use a package like miniCRAN outside of your airgapped system to build a selective copy of CRAN. You can specify the packages you want and the package will download all dependencies. You can then copy the downloaded directories to your server, point install.packages in the right direction and install as usually using install.packages. For details see https://andrie.github.io/miniCRAN/articles/miniCRAN-introduction.html.

You might also run into the problem that your system does not have all of the depencies needed to build all of the packages. Under ubuntu you need for example to install libxml2-dev to be able to install the xml package. For that you need to use the package manager of ubuntu. How to do that on an airgapped system is another issue

Jan van der Laan
  • 8,005
  • 1
  • 20
  • 35