所以我在私人仓库中制作了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.
答案 0 :(得分:7)
只需安装版本化的commmon-package:
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
这样的版本。
这样的版本控制方案是明确禁止的non-native
包,例如检查DebianMentorsFAQ。
由于你创建包的方式,你真的应该创建像57.3.102-1
这样的版本(即<upstreamversion>-<pkgversion>
),即使<pkgversion>
总是“1”。