由于 R 已经安装,您应该能够使用这种方法升级它。首先,您可能希望在新版本中安装以前版本中安装的软件包,因此检查这个 邮寄是很方便的。然后,按照 here的说明进行操作
打开 sources.list文件:
sudo nano /etc/apt/sources.list
在源代码中添加一行来检索包。例如:
deb https://cloud.r-project.org/bin/linux/ubuntu/ version/
用您想使用的 镜子替换 https://cloud.r-project.org,并替换
version/ with whatever 版本 of Ubuntu you are using (eg, trusty/, xenial/, and so on). If you're getting a "Malformed line error", check to see if you have a space between /ubuntu/ and version/.
Recover your old packages following the solution that best suits to you (see this). For instance, to recover all the packages (not only those from CRAN) the idea is:
-- copy the packages from R-oldversion/library to R-newversion/library, (do not overwrite a package if it already exists in the new version!).
——运行 R 命令 update.packages(checkBuilt=TRUE, ask=FALSE)。