1

I have an offline Debian VM on which I would like to install the version of R - 3.2.3. Yet, since the VM can't be directly connected to outside internet, I can only scp source file to it from my local which has internet access.

First, I have tried default "apt-get install..." to install r-base and r-base-dev from local repo on the Debian VM:

$ sudo apt-get install r-base r-base-dev

Yet, I can only get r version 3.1.1 from repo. So, I followed an solution from this post: https://unix.stackexchange.com/questions/153194/installing-latest-r-base-from-r-project

I added "deb http://cran.rstudio.com/bin/linux/debian wheezy-cran3/" to the "/etc/apt/sources.list" file. Yet, since the VM can't connect to internet, the system timed out when I ran the following commands as the instruction:

gpg --keyserver pgpkeys.mit.edu --recv-key 06F90DE5381BA480

gpg -a --export 06F90DE5381BA480 |sudo apt-key add -

However, as a test, I still go ahead to reinstall r-base & r-base-dev:

$ sudo apt-get --purge remove r-base r-base-dev
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install r-base r-base-dev

I somehow did get the latest r version installed on my VM:

R version 3.2.5 (2016-04-14) -- "Very, Very Secure Dishes"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Yet, i have also had error message when installing r:

WARNING: The following packages cannot be authenticated!
r-base-core r-recommended r-base r-base-dev

I am sure that I didn't do it right.. Yet, would like any help on how to correctly install latest r version on my offline Debian VM. Thanks guys!

Community
  • 1
  • 1
Mark Li
  • 429
  • 1
  • 7
  • 21
  • 1
    If my count is right then this is the third time you are asking this question within the last few days. Why? – Dirk Eddelbuettel May 01 '16 at 19:12
  • Hi @Dirk Eddelbuettel Yes, it is about the same project but each post is for a different dimension of the problems I encountered such as for installing offline R packages, installing shiny server, and build latest version of r from source. They are all different. – Mark Li May 01 '16 at 19:24

1 Answers1

1

Run the following commands on your local machine(with internet access):

  1. Download the required packages: apt-get download r-base r-base-dev r-requirements
  2. The above command will download the .deb packages for you in the current directory.
  3. Copy(scp) the r-base_3.2.3-4_all.deb, r-base-dev_3.2.3-4_all.deb and r-recommended_3.2.3-4_all.deb to your Debian VM.
  4. Now you can install the packages using the following command: sudo dpkg -i r-base_3.2.3-4_all.deb r-base_3.2.3-4_all.deb r-recommended_3.2.3-4_all.deb.

Note: Keep an eye on the package versions. Also, if dpkg -i command is asking for any other requirements, you would need to download those as well and pass all the downloaded .deb packages to the dpkg -i command.

RaviTezu
  • 3,047
  • 19
  • 26
  • awesome! This is exactly what I was looking for! Thank you! – Mark Li May 01 '16 at 19:27
  • Oh a quick question - my local machine is on Mac which is on a different os from Debian. So, the package I down from "home brew" on Mac will not be in the .deb format, right? – Mark Li May 01 '16 at 19:39
  • I downloaded the .deb packages manually and scp to the VM. After run the dpkg to install those packages, it returns error message: dpkg: dependency problems prevent configuration of r-base: r-base depends on r-recommended (= 3.2.3-4); however: Version of r-recommended on system is 3.2.5-1~wheezycran.0. Do I need to add configuration to the source.list file? – Mark Li May 01 '16 at 20:09
  • Thanks! I scp all necessary deb files and ran "$ sudo dpkg -i r-base-core_3.2.3-4_amd64.deb r-base_3.2.3-4_all.deb r-base-dev_3.2.3-4_all.deb r-recommended_3.2.3-4_all.deb" Yet, I have got error "dpkg: dependency problems prevent configuration of r-recommended: r-recommended depends on r-cran-boot (>= 1.2.19); however: Package r-cran-boot is not installed." ;( – Mark Li May 02 '16 at 14:39
  • Download the `r-cran-boot` package and pass it to `dpkg -i` command and you will have to repeat this process until you don't have any dependency left. – RaviTezu May 02 '16 at 14:59
  • Gotcha. On this download page of "r-cran-boot": https://packages.debian.org/jessie/r-cran-boot, which source file format should I download? .dsc, .tar.gz, diff.gz? Also, is it in wheezy, jessie, stretch, or sid? – Mark Li May 02 '16 at 15:49
  • Thanks! I got it - never mind.:) – Mark Li May 02 '16 at 16:04
  • @MarkLi RaviTezu - I am exactly in similar situation but unfortunately new to R. Is there any resources that you can help me with? – The Great Aug 05 '21 at 14:11
  • can help me with this post please? https://stackoverflow.com/questions/68099156/update-r-in-ubuntu-using-rstudio-offline-enrionment – The Great Aug 05 '21 at 14:12