当R(v3.2.5)启动时,则发生错误"无法加载共享对象"在ubuntu 12.04上

时间:2016-08-31 08:37:57

标签: r ubuntu

在ubuntu 12.04(64位)上安装R v3.2.5后,在命令行启动R,我可以看到如下错误:

***
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)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

**Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/usr/lib/R/library/stats/libs/stats.so':
  libm.so.11835d88: cannot open shared object file: No such file or directory
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found**
***

我安装一些软件包时会发现同样的错误。我怎么解决这个?

我添加了一些关于stats.so的信息

R# R CMD ldd /usr/lib/R/library/stats/libs/stats.so
/usr/lib/R/library/stats/libs/stats.so: /usr/local/lib64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3gf)
        linux-vdso.so.1 =>  (0x00007fffb75f6000)
        liblapack.so.3gf => /usr/lib/liblapack.so.3gf (0x00007f9cdef48000)
        libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007f9cdecca000)
        libgfortran.so.3 => /usr/local/lib64/libgfortran.so.3 (0x00007f9ccec89000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9cce98c000)
        libR.so => /usr/lib/R/lib/libR.so (0x00007f9cce3bf000)
        libgomp.so.1 => /usr/local/lib64/libgomp.so.1 (0x00007f9cce1b2000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9ccdf94000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9ccdbd6000)
        libgcc_s.so.1 => /usr/local/lib64/libgcc_s.so.1 (0x00007f9ccd9c1000)
        libm.so.11835d88 => not found
        libc.so.11835d88 => not found
        libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 (0x00007f9ccd77e000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9ccd540000)
        liblzma.so.5 => /usr/lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f9ccd31e000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f9ccd10e000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9cccf05000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9cccd01000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9cdf9a3000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f9cccad9000)

1 个答案:

答案 0 :(得分:0)

根据DirkEddelbuettel的建议,我从我的linux(ubuntu 12.04)和我从机器中的其他软件包复制的.so文件中删除了r-base。然后我用指南“UBUNTU PACKAGES FOR R”重新安装了r-base。

在我之前安装的过程中,没有安装r-base软件包支持的软件包(依赖软件包)的步骤。

这是命令。

sudo apt-get build-dep r-base

安装此推荐软件包之后,启动R控制台没有错误。