【发布时间】:2019-10-19 22:40:04
【问题描述】:
我正在尝试在一个相当旧的 ubuntu xenial 版本上将 R 从 3.4.4 升级到 3.6.0。
我按照以下说明操作:here
这是我采取的步骤:
- sudo apt-get remove r-base-dev
- echo 'deb https://cloud.r-project.org/bin/linux/ubuntu trusty-cran35/' | sudo tee -a /etc/apt/sources.list
- sudo apt-get 更新
- sudo apt-get install r-base-dev
我的 R 版本更新到 3.6,但是,每当我在控制台中启动 R 时,我都会收到以下消息:
Error: package or namespace load failed for ‘utils’:
.onLoad failed in loadNamespace() for 'utils', details:
call: file(con, "r")
error: cannot open the connection
Error: package or namespace load failed for ‘stats’:
.onLoad failed in loadNamespace() for 'utils', details:
call: file(con, "r")
error: cannot open the connection
During startup - Warning messages:
1: In file(con, "r") :
cannot open file '/etc/os-release': Permission denied
2: package ‘utils’ in options("defaultPackages") was not found
3: In file(con, "r") :
cannot open file '/etc/os-release': Permission denied
4: package ‘stats’ in options("defaultPackages") was not found
这是 /etc/os-release 的输出。我对 666 做了 chmod,但没有任何改变。
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
这是我的 libPaths 的输出。
> .libPaths()
[1] "/home/myuser/R/x86_64-pc-linux-gnu-library/3.6"
[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"
我无法在 R 中安装任何软件包。任何帮助将不胜感激。
仅供参考 - 机器上安装了一个我根本没有接触过的 rstudio 服务器。
【问题讨论】:
-
我假设您还没有升级到新版本的 Ubuntu,因为它不是您的机器?
-
是的,你是对的。这是一个公司服务器,我碰巧在上面工作:)
-
ls /etc/os-release -li的输出是什么? -
@duckmayr 这里是:
1845913 -rw-rw-rw- 1 root root 249 Aug 1 2016 /etc/os-release -
多么奇怪。我还没有修复(还没有?),但这是发生了什么:在
.onLoad()中为utils,.osVersion()is called。.osVersion()attempts to read /etc/os-release,在您的情况下,无法打开与文件的连接。
标签: r ubuntu-14.04