我有 R 版本 3..并且需要安装 v4 才能首先我尝试更新 R 但没有成功。作为这个帖子建议我删除 R 包。当我尝试删除其输出的文件夹时,它R -e '.libPaths()
告诉我没有这样的文件夹。然后我尝试按照R官方网页中的方式安装R v4。
sudo apt update -qq
sudo apt install --no-install-recommends software-properties-common dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
sudo apt install --no-install-recommends r-base
它给了我下面的输出。现在我不知道该怎么办,你能帮我吗?我使用的是Ubuntu 16
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-base : Depends: r-base-core (>= 4.1.0-1.2004.0) but it is not going to be installed
Depends: r-recommended (= 4.1.0-1.2004.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
答案1
总结问题
- 用户认为操作系统版本是“Ubuntu 16”
lsb_release -cs
返回bionic
即 Ubuntu 18.04- 尝试安装时
r-base
提示存在 Ubuntu 20.04 (focal
) 存储库
通过评论/聊天,我们发现根本问题是用户源中不同分布的混合,包括以下 R 特定分布:
deb cloud.r-project.org/bin/linux/… focal-cran40/
deb [arch=i386,amd64] cran.rstudio.com/bin/linux/… xenial/
deb cloud.r-project.org/bin/linux/… bionic-cran40/
注释掉所有非仿生存储库并重新运行后apt update
,用户能够完成安装。