How can I install a R package on a offline Debian machine?

后端 未结 4 1818
逝去的感伤
逝去的感伤 2021-01-28 10:53

I have an Debian VM which is not connected to internet. Yet, I can still scp any file from my local machine which does have internet connection. To provide a little bit context,

4条回答
  •  滥情空心
    2021-01-28 11:57

    Shiny has a few package dependencies, and "R CMD INSTALL" won't find them for you, so you need to get them manually. According to the description of shiny, it's dependencies are: 'Rcpp’, ‘httpuv’, ‘mime’, ‘jsonlite’, ‘xtable’, ‘digest’, ‘htmltools’, ‘R6’. So first, get the packages from cran (below are current versions, but they do change over time. Note below is for the computer connected to the internet, you'll need to scp these to the offline computer before continuing):

    wget https://cran.r-project.org/src/contrib/Rcpp_0.12.4.tar.gz 
    wget https://cran.r-project.org/src/contrib/httpuv_1.3.3.tar.gz 
    wget https://cran.r-project.org/src/contrib/mime_0.4.tar.gz 
    wget https://cran.r-project.org/src/contrib/jsonlite_0.9.19.tar.gz 
    wget https://cran.r-project.org/src/contrib/digest_0.6.9.tar.gz 
    wget https://cran.r-project.org/src/contrib/htmltools_0.3.5.tar.gz 
    wget https://cran.r-project.org/src/contrib/R6_2.1.2.tar.gz 
    wget https://cran.r-project.org/src/contrib/shiny_0.13.2.tar.gz
    

    Then go through them in that same order with R CMD INSTALL. eg:

    R CMD INSTALL Rcpp_0.12.4.tar.gz
    

    Once all the dependencies are there, R CMD INSTALL should let you install shiny.

提交回复
热议问题