0

I need to automate package installation with zypper that requires selecting a solution. How can this be done in non-interactive mode?

# zypper in /tmp/repos-sles15-sp2-current.x86_64.rpm
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: nothing provides sles-release = 15.2 needed by repos-sles15-sp2-x86_64-20210609-1.x86_64
 Solution 1: do not install repos-sles15-sp2-x86_64-20210609-1.x86_64
 Solution 2: break repos-sles15-sp2-x86_64-20210609-1.x86_64 by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/c/d/?] (c): c

I need to select option #2. What I've tried:

  1. echo 2 | zypper in /tmp/repos-sles15-sp2-current.x86_64.rpm
  2. yes 2 | zypper in /tmp/repos-sles15-sp2-current.x86_64.rpm
  3. zypper in /tmp/repos-sles15-sp2-current.x86_64.rpm --force -y

Does anyone know a trick that help with selecting option #2?

Dziki_Jam
  • 17
  • 5
  • Install both packages in the same command line. Be aware that the task you are attempting may damage your system and make it unusable to the point where it must be reinstalled from scratch. – Michael Hampton Jun 22 '21 at 15:13

2 Answers2

0

It seems like you're installing a package that was not meant for the version of your operating system. Can't you find the repos*rpm package for your exact version?

Not recommendend, but you could use

rpm -i --nodeps /tmp/repos-sles15-sp2-current.x86_64.rpm

but that ignores all dependencies, also the ones that would have been installed.

Chris Maes
  • 570
  • 2
  • 9
  • It worked, thank you very much. :) I bit of off topic: I realize it shouldn't be that way, but it's company-internal stuff, so there's not much I can do. I'm even surprised that the package doesn't break the system, it actually works, the repos get updated, and I can install software from them. – Dziki_Jam Jun 25 '21 at 07:47
0

how about --best-effort, this option helped me in the case of one dependency obsoletes the other one when i was updating both of them.