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

后端 未结 4 1812
逝去的感伤
逝去的感伤 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:42

    You are in a pickle. The R package mechanism expects you to be connected to get dependencies. That said, you can get some help:

    R> AP <- available.packages(contrib.url(options("repos")$repos[1]))
    R> revs <- tools::package_dependencies("shiny", AP, recursive=TRUE)[[1]]
    R> revs
     [1] "methods"   "utils"     "httpuv"    "mime"     
     [5] "jsonlite"  "xtable"    "digest"    "htmltools"
     [9] "R6"        "Rcpp"      "tools"     "stats"    
    R> 
    

    You can now look into AP again and feed this into download.packages().

    Also, several (all ?) of these are in a newer Debian distro so you could use apt-get in download-mode (maybe using apt-offline as suggested in the other question).

    Lastly, we do offer a Docker container for shiny so if you use that on your VM you don't need anything else.

提交回复
热议问题