2

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
  • 219

2 Answers2

1

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.

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.