How to install stringi from local file (ABSOLUTELY no Internet Access)

二次信任 提交于 2021-02-06 10:00:35

问题


I am working on a remote server using RStudio. This server has no access to the Internet. I would like to install the package "stringi." I have looked at this stackoverflow article, but whenever I use the command

install.packages("stringi_0.5-5.tar.gz", 
                 configure.vars="ICUDT_DIR=/my/directory/for/icudt.zip")

It simply tries to access the Internet, which it cannot do. Up until now I have been using Tools -> Install Packages -> Install from Packaged Archive File. However, due to this error, I can no longer use this method.

How can I install this package?


回答1:


If you have no internet access on local machines, you can build a distributable source package that includes all the required ICU data files (for off-line use) by omitting some relevant lines in the .Rbuildignore file. The following command sequence should do the trick:

wget https://github.com/gagolews/stringi/archive/master.zip -O stringi.zip
unzip stringi.zip
sed -i '/\/icu..\/data/d' stringi-master/.Rbuildignore
R CMD build stringi-master

Assuming the most recent development version is 1.3.1, a file named stringi_1.3.1.tar.gz is created in the current working directory. The package can now be installed (the source bundle may be propagated via scp etc.) by executing:

R CMD INSTALL stringi_1.3.1.tar.gz

or by calling install.packages("stringi_1.3.1.tar.gz", repos=NULL), from within an R session.




回答2:


For a Linux machine the easiest way is from my point of view:

  1. Download the release you need from Rexamine in tar.gz format to your local pc. In opposition to the version on CRAN it already contains the icu55\data\ folder.
  2. Move the archive to your target linux machine without internet access
  3. run R CMD INSTALL stringi-1.0-1.tar.gz (in case of release 1.0-1)



回答3:


You provided the wrong value of configure.vars. It indicates that you have to give the directory's name, not a final file name.

Correct your code to the following:

install.packages("stringi_0.5-5.tar.gz", 
                 configure.vars="ICUDT_DIR=/my/directory/for/")

Regards, Sean




回答4:


Follow the steps below

  1. Download icudt55l.zip seperately from server where you have internet access with wget http://www.mini.pw.edu.pl/~gagolews/stringi/icudt55l.zip
  2. Copy the downloaded packages to the server where you want to install stringi
  3. Execute the following command R CMD INSTALL --configure-vars='ICUDT_DIR=/tmp/ALL' stringi_1.1.6.tar.gz

icudt55l.zip is copied to /tmp/ALL



来源:https://stackoverflow.com/questions/31942322/how-to-install-stringi-from-local-file-absolutely-no-internet-access

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!