【发布时间】:2021-09-13 07:43:52
【问题描述】:
我正在尝试通过 SUSE Micro OS 中的 zypper 包管理器安装一个包。
我正在尝试借助 bash/shell 脚本自动安装软件包。
$ zypper install libopenssl-devel
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: nothing provides libopenssl0_9_8 = 0.9.8h needed by libopenssl-devel-0.9.8h-30.11.x86_64
Solution 1: do not install libopenssl-devel-0.9.8h-30.11.x86_64
Solution 2: break libopenssl-devel-0.9.8h-30.11.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/c] (c):
作为过程的一部分,我想预先选择解决方案 2,也就是说,我需要一种方法来选择 脚本本身的首选解决方案。
我尝试了一些选项,但没有成功。以下所有选项都选择选项 c,这是默认行为。
zypper install libopenssl-devel <<< echo "2"
echo "2" | zypper install libopenssl-devel
zypper -n install --force libopenssl-devel
我无法使用 rpm 包管理器。
【问题讨论】:
-
你可以试试
zypper --non-interactive ... -
你好@LMC,我试过了。它对我不起作用。
-
你好@AhmetSaidAkbulut,我试过了。它对我不起作用。
-
我想强调这个问题。问题更多在于 zypper 命令本身。不在脚本方面。需要有关如何在脚本本身中为 zypper 命令提供预选择的帮助,以便 zypper 将使用该选择。