1.在安装R之前在source.list的最前面加上源(例如清华的源)
2.在最后面加上 .deb的文件
To obtain the latest R 3.5 packages, add an entry like
deb https://cloud.r-project.org/bin/linux/ubuntu cosmic-cran35/
or
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
or
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/
or
deb https://cloud.r-project.org/bin/linux/ubuntu trusty-cran35/
in your /etc/apt/sources.list file. By using https://cloud.r-project.org, you will be automatically be redirected to a nearby CRAN mirror. See https://cran.r-project.org/mirrors.html for the current list of CRAN mirrors.
之前系统是Ubuntu16.04.5的时候,选的是....xenial-cran35/。现在安装的是Ubuntu18.04
lsb_release -a
显示是