为什么指定旧版本时 apt-get install 依赖项解析不起作用?

为什么指定旧版本时 apt-get install 依赖项解析不起作用?

以下内容曾经有效,但现在无效:

apt-get install r-base=3.3.1-1trusty0 r-base-dev=3.3.1-1trusty0 r-recommended=3.3.1-1trusty0 r-base-core=3.3.1-1trusty0
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-recommended : Depends: r-cran-mgcv (>= 1.1.5) but it is not going to be installed
                 Depends: r-cran-nlme (>= 3.1.52) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

如果我删除版本(例如 3.3.1-1trusty0),apt-get install 就可以正常工作。

这个答案注意到在指定版本时,“您可能需要自己进行一些依赖关系解析”。

为什么指定版本后依赖关系解析会失败?大约一个月前,使用相同命令(使用这些版本)执行 apt-get install 时,为什么成功且没有依赖性错误?

答案1

您的旧版本必须满足两个标准。

1)旧版本必须位于 apt 可以看到的一个存储库中。

2)旧版本不得破坏系统上的其他软件。

您的错误消息,尤其是有关“持有损坏的包裹”的错误,表明版本冲突。版本冲突意味着旧软件包违反了第 2 条,并且即将破坏系统的其他部分。

依赖项诸如此类的设置foo 1.1 depends upon libfoo(>0.98)都是由软件打包者在创建软件包时设置的。打包者都是志愿者 - 你也可以学着去做。

懒惰的打包者只会使用他们手头上现有的依赖项。例如:foo 1.1 depends upon libfoo(=1.1)。依赖项版本缺乏灵活性会给用户带来很多问题。许多 PPA 和其他非 Ubuntu 源软件中都有懒惰的软件包,这也是它们被不支持来源。

更有经验的打包者会测试他们的软件包,以实现具有最广泛依赖版本的功能。例如:foo 1.1 depends upon libfoo(>=0.75)。这些软件包通常可以在 Debian 中找到,并在每个发布周期导入到 Ubuntu。

发行版像 Debian 和 Ubuntu 这样的发行版都是“快照”发行版。每个版本都基于一个稳定的快照。较旧的快照位于较旧的版本中。由于版本不断变化,这通常意味着许多软件包仅与它们所针对的版本兼容。

如果您想运行较旧的软件包,通常必须在较旧的 Ubuntu 版本中执行此操作(例如,使用 VM)。您可以在任何您想要的系统上安装较旧的软件……但不能通过使用软件包来安装。

相关内容