在Ubuntu上安装R和Rstudio的时候碰到了一些依赖项不存在的错误

The following packages have unmet dependencies:
r-base-core : Depends: libc6 (>= 2.27) but 2.23-0ubuntu10 is to be installed
Depends: libcurl4 (>= 7.28.0) but it is not installable
Depends: libicu60 (>= 60.1-1~) but it is not installable
Depends: liblapack3 but it is not going to be installed or
liblapack.so.3
Depends: libreadline7 (>= 6.0) but it is not installable
Recommends: r-recommended but it is not going to be installed
Recommends: r-base-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

看着像依赖项冲突

apt命令其实不能很好处理冲突的情况, 最好使用aptitude

sudo apt-get install aptitude

sudo aptitude install r-base

会提示哪些包出现来冲突

nstalled.
libicu-dev : Depends: libicu55 (= 55.1-7) but 55.1-7ubuntu0.4 is installed.
The following actions will resolve these dependencies:

Keep the following packages at their current version:
1) gfortran [Not Installed]
2) gfortran-5 [Not Installed]
3) libblas-dev [Not Installed]
4) libgfortran-5-dev [Not Installed]
5) libgfortran3 [Not Installed]
6) libicu-dev [Not Installed]
7) libjpeg-dev [Not Installed]
8) libjpeg-turbo8-dev [Not Installed]
9) libjpeg8-dev [Not Installed]
10) liblapack-dev [Not Installed]
11) liblapack3 [Not Installed]
12) libpng12-dev [Not Installed]
13) r-base [Not Installed]

,以及有哪些方案

Accept this solution? [Y/n/q/?] .
The following actions will resolve these dependencies:

Keep the following packages at their current version:
1) libjpeg-dev [Not Installed]
2) libjpeg-turbo8-dev [Not Installed]
3) libjpeg8-dev [Not Installed]
4) r-base-dev [Not Installed]

Downgrade the following packages:
5) cpp-5 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
6) g++-5 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
7) gcc-5 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
8) gcc-5-base [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
9) libasan2 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
10) libatomic1 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
11) libcc1-0 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
12) libcilkrts5 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
13) libgcc-5-dev [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
14) libgomp1 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
15) libicu55 [55.1-7ubuntu0.4 (now) -> 55.1-7 (xenial)]
16) libitm1 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
17) liblsan0 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
18) libmpx0 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
19) libpng12-0 [1.2.54-1ubuntu1.1 (now) -> 1.2.54-1ubuntu1 (xenial)]
20) libquadmath0 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
21) libstdc++-5-dev [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenia
22) libstdc++6 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
23) libtsan0 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]
24) libubsan0 [5.4.0-6ubuntu1~16.04.10 (now) -> 5.3.1-14ubuntu2 (xenial)]

Leave the following dependencies unresolved:
25) r-base-core recommends r-base-dev

解决冲突后即可安装成功

在shell里输入R,提示成功

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

最新文章

  1. Easyui datagrid editor为combobox时指定数据源
  2. O365(世纪互联)SharePoint 之文档库使用小记
  3. 如丝般顺滑地从Windows迁移SQLServer数据库到Linux
  4. .offset().top是什么意思?
  5. null 和 NULL 判断
  6. collection中的retainAll()方法
  7. DataTable使用技巧总结【转】
  8. paip.powerdesign cdm pdm文件 代码生成器 java web 页面 实现
  9. Tomcat配置虚拟主机后的登录验证码问题
  10. Spring中Quartz调度器的使用
  11. Goolg Chrome 插件开发--Hello world
  12. c#基础汇总-------------封装
  13. orm框架的学习mybatis
  14. Windows phone 8 学习笔记(7) 设备
  15. WPF:警惕TextBox会占用过多内存
  16. Linux基础四
  17. R语言︱文本挖掘套餐包之——XML+SnowballC+tm包
  18. Flash与EEPROM
  19. Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Unable to compile class for JSP] with root cause java.lang.IllegalArgumentException: Page directive: inval
  20. git宝典—应付日常工作使用足够的指北手册

热门文章

  1. BNU 13024 . Fi Binary Number 数位dp/fibonacci数列
  2. AngularJS 1.x 国际化——Angular-translate例子
  3. 洛谷 P2634 聪聪可可 —— 树形DP / 点分治
  4. bag of words in c++
  5. bzoj4299
  6. 基于Hive的手机应用信息统计分析系统
  7. HTTP缓存控制 总结
  8. E20171028-hm
  9. $stylus美化$
  10. LDA PCA 学习笔记