【问题标题】:Debian package dependencies, installing specific version, not the latestDebian包依赖,安装特定版本,不是最新的
【发布时间】:2013-08-02 17:00:52
【问题描述】:

所以我有一个在我的私人仓库中制作的 Debian 包,我想安装一个特定的版本。

该软件包有一个公共的 lib 依赖项,我想安装该软件包的匹配版本。 apt-get 坚持安装依赖的最新版本,而不是包所依赖的版本。

你可以在这里看到命令的输出:

cmcc@cmcc-VirtualBox:~/Desktop/repo$ sudo apt-get install my_program=57.0.93
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:
 my_program : Depends: my_program-common (= 57.0.93) but 57.3.102 is to be installed
E: Unable to correct problems, you have held broken packages.

【问题讨论】:

    标签: dependencies package debian apt-get


    【解决方案1】:

    也只需安装版本化的commmon-package:

    aptitude install my_program=57.0.93 my_program-common=57.0.93
    

    注意:通常aptitude 在解决依赖关系方面比apt-get 做得更好。用法非常相似,因此很容易切换。

    更新

    如果您可以接受交互式过程,最简单的方法可能是让aptitude 给您一些建议并选择降级软件包的建议。例如:

    # aptitude install my_program=57.0.93-1
    The following packages will be DOWNGRADED:
      my_program{b} 
    0 packages upgraded, 0 newly installed, 1 downgraded, 0 to remove and 3 not upgraded.
    Need to get 180 kB of archives. After unpacking 12.3 kB will be used.
    The following packages have unmet dependencies:
     my_program : Depends: my_program-common (= 57.0.93-1) but 57.3.102-1 is to be installed
    The following actions will resolve these dependencies:
    
         Remove the following packages:              
    1)     my_program-common                                  
    2)     my_program
    
         Leave the following dependencies unresolved:
    3)     my_program recommends my_program-foo      
    
    
    Accept this solution? [Y/n/q/?] n
    The following actions will resolve these dependencies:
    
         Downgrade the following packages:
    1)     my_program-common [57.3.102-1 (now, unstable) -> 57.0.93-1 (stable)]
    
    Accept this solution? [Y/n/q/?] Y
    

    关于包版本的注意事项

    您的软件包似乎有一个类似57.0.93 的版本。 对于non-native 包,明确禁止这样的版本控制方案,例如检查DebianMentorsFAQ

    您确实应该创建像57.3.102-1(即<upstreamversion>-<pkgversion>)这样的版本,即使<pkgversion> 始终为“1”,由于您创建包的方式。

    【讨论】:

    • 不幸的是,我不能真正做到这一点,因为还有许多不同的依赖项也与 my_program 的版本不同。我真的更喜欢包管理自己的依赖项的解决方案。我也想过使用预安装脚本来管理它,我可能不得不这样做。
    • @Ciarán,我更新了答案,添加了一个示例,说明如何以交互方式使用 aptitude 以允许使用依赖项进行降级
    猜你喜欢
    • 1970-01-01
    • 2014-06-24
    • 2021-01-01
    • 2018-10-28
    • 2019-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多