R 的版本是 3.4,想将其升级到 3.6。然后我按照以下步骤操作:
sudo /bin/bash
然后我就去 root 了。
然后删除 r-base 核心:
# apt-get remove r-base-core
结果如下:
Package 'r-base-core' is not installed, so not removed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/"
然后添加公钥:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
在那之后:
apt-get update
apt-get upgrade
最后
apt-get install r-base
但是我得到的是错误:
The following packages have unmet dependencies: r-base : Depends: r-base-core (>= 3.6.2-1bionic) but it is not going to be installed Depends: r-recommended (= 3.6.2-1bionic) but it is not going to be installed Recommends: r-base-html but it is not going to be installed E: Unable to correct problems, you have held broken packages.
我尝试单独安装 3.6.2-1bionic,但不起作用。
您能告诉我如何修复此问题吗?
答案1
我已经尝试过这个并且对我有用:我只是对源列表中的先前存储库进行了如下评论:
$sudo nano /etc/apt/sources.list
评论 R 的先前版本
# deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ xenial main restricted
并添加新的版本存储库:
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/
然后添加公钥:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
and finally update and instal r-base
sudo apt-get update
sudo apt-get install r-base