这似乎是一个一直重复出现的问题,但我找到的答案对我没有帮助。
我在 Ubuntu 16.04 上安装较新版本的 R 时遇到了问题。我按照这里的答案操作安装最新版本的 R-base和这里https://cran.rstudio.com/bin/linux/ubuntu/README.html并将其添加deb https://cran.uni-muenster.de/bin/linux/ubuntu zesty/
到我的/etc/apt/sources.list.d
文件夹中,文件名为r.list
但这对我来说不起作用。删除 R 并尝试安装 r-base 后,我仍然得到:
$sudo apt-get install r-base
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 (>= 3.4.1-2zesty0) but it is not going to be installed
Depends: r-recommended (= 3.4.1-2zesty0) 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.
为什么依赖项未安装?
你知道如何在我的 16.04LTS ubuntu 上从 Zesty Zapus (17.04) 获取 R 版本吗?
答案1
我的 ubuntu 17.10 也出现了同样的问题。我通过从下载 libpng12-0 解决了这个问题https://packages.ubuntu.com/xenial/amd64/libpng12-0/download
然后使用命令安装:
sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb
最后,运行以下命令来安装 R(假设您已经添加了 R 存储库):
sudo apt-get install r-base-dev
我希望它能对你有所帮助。