我正在嘗試在 ubuntu 上為我的閃亮服務器安裝“預測”包。我的終端上的那個程序只是卡住了,一旦停止安裝-它說:
ERROR: compilation failed for package ‘RcppArmadillo’
所以我嘗試但未能以兩種不同的方式安裝“RcppArmadillo”:
通過 R 的第一種方式(再次卡住):
install.packages("RcppArmadillo")
and again it get stuck:
config.status: creating src/Makevars
** libs
g -std=gnu 11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppArmadillo.cpp -o RcppArmadillo.o
g -std=gnu 11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g -std=gnu 11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fastLm.cpp -o fastLm.o
^Cmake: *** [/usr/lib/R/etc/Makeconf:177: fastLm.o] Interrupt
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/shiny/R/x86_64-pc-linux-gnu-library/4.1/RcppArmadillo’
第二種方式:
$ sudo apt install r-cran-rcpparmadillo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-cran-rcpparmadillo : Depends: r-api-3.5
Depends: r-cran-rcpp (>= 0.11.0) but it is not going to be installed
Depends: r-cran-pkgkitten but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
有什么建議?提前致謝
uj5u.com熱心網友回復:
這(實際上)也是一個常見問題解答。最好的辦法是在 CRAN 上查看 Ubuntu 的 README 大約 5k 包,以便添加 PPA。之后,sudo apt install r-cran-rcpparmadillo將為您提供當前版本。
這是我在其中一個 Rocker Projects 容器中所做的事情:
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
software-properties-common \
dirmngr \
ed \
less \
locales \
vim-tiny \
wget \
ca-certificates \
&& add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0" \
&& add-apt-repository --enable-source --yes "ppa:c2d4u.team/c2d4u4.0 "
您可能需要也可能不需要安裝才能安裝dirmngr,software-properties-common所以也許嘗試一下
sudo add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0"
sudo add-apt-repository --enable-source --yes "ppa:c2d4u.team/c2d4u4.0 "
如果您已經從 CRAN 獲得了當前的 R,則不需要第一個,它是 CRAN 鏡像的源代碼庫。但是c2d4u4.0 對于focal.
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/454498.html
標籤:r ubuntu rcpparmadillo
