Dependencies Debian软件包依赖项,安装特定版本,而不是最新版本

Dependencies Debian软件包依赖项,安装特定版本,而不是最新版本,dependencies,package,debian,apt-get,Dependencies,Package,Debian,Apt Get,所以我有一个Debian软件包,我已经在我的私人回购,我想安装一个特定的版本 该软件包有一个公共库依赖项,我想安装该软件包的匹配版本apt get坚持安装依赖项的最新版本,而不是软件包依赖的版本 您可以在此处看到命令的输出: cmcc@cmcc-VirtualBox:~/Desktop/repo$ sudo apt-get install my_program=57.0.93 Reading package lists... Done Building dependency tree

所以我有一个Debian软件包,我已经在我的私人回购,我想安装一个特定的版本

该软件包有一个公共库依赖项,我想安装该软件包的匹配版本
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.

只需安装版本化的commmon软件包:

aptitude install my_program=57.0.93 my_program-common=57.0.93
注意:一般来说,
aptitude
在解决依赖关系方面比
apt-get
做得好得多。用法非常相似,因此很容易切换

更新 如果你能接受互动过程,最简单的方法可能是让
aptitude
给你一些建议,然后选择一个降低软件包等级的建议。e、 g:

# 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
。 此类版本控制方案明确禁止用于
非本机
软件包,例如检查


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

不幸的是,我不能这样做,因为还有许多不同的依赖项,它们与我的\u程序的版本不同。我真的更喜欢一个解决方案,其中包管理自己的依赖项。我还考虑过使用预安装脚本来管理它,这可能是我必须要做的。@Ciarán,我更新了答案,添加了一个示例,说明如何交互使用
aptitude
来允许带有依赖项的降级