我尝试在虚拟机上下载 R,但由于某些原因,出现以下错误:
~$ sudo apt 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.6.3-1~bustercran.0) but it is not going to be installed
Depends: r-recommended (= 3.6.3-1~bustercran.0) 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.
如果我运行:sudo nano /etc/apt/sources.list
我会看到以下内容:
deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main
deb http://deb.debian.org/debian/ stretch-updates main
deb-src http://deb.debian.org/debian/ stretch-updates main
deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
deb-src [arch=amd64] https://download.docker.com/linux/debian stretch stable
deb https://cloud.r-project.org/bin/linux/debian buster-cran35/
如果我跑步apt-cache policy r-base
我会看到:
r-base:
Installed: (none)
Candidate: 3.6.3-1~bustercran.0
Version table:
3.6.3-1~bustercran.0 500
500 https://cloud.r-project.org/bin/linux/debian buster-cran35/ Packages
3.6.2-1~bustercran.0 500
500 https://cloud.r-project.org/bin/linux/debian buster-cran35/ Packages
3.6.1-2~bustercran.0 500
500 https://cloud.r-project.org/bin/linux/debian buster-cran35/ Packages
3.6.0-2~bustercran.0 500
500 https://cloud.r-project.org/bin/linux/debian buster-cran35/ Packages
3.6.0-1~bustercran.0 500
500 https://cloud.r-project.org/bin/linux/debian buster-cran35/ Packages
3.3.3-1 500
500 http://deb.debian.org/debian stretch/main amd64 Packages
知道问题出在哪里吗?
答案1
Your/etc/apt/sources.list
表示主操作系统的包存储库使用版本代号stretch
,而您的 R 存储库标识符包括名称buster
。
您正在尝试混合用于两个不同 Debian 版本的软件包:Debian 9“stretch”和 Debian 10“buster”。这是不支持和已知会引起问题。
Debian 9 已经过了其常规生命周期结束日期 2020 年 7 月 6 日,并处于长期支持状态,预计将于 2022 年某个时候结束。Debian 11 即将成为新的稳定版本,因此您应该在此之前,您可能会将您的系统完全升级到 Debian 10“buster”,以保证顺利升级。Debian 10 的发行说明中描述了升级过程:升级前请仔细阅读。
当 Debian 11 发布并成为新stable
版本时,将有一个存储库过渡的时间,Debian 10oldstable
和 Debian 9oldoldstable
分别成为。当新状态镜像到世界各地的 Debian 存储库时,这可能会导致一些暂时的混乱。您不希望在此过程中尝试执行从stretch
到 的升级。buster