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:
- echo 2 | zypper in /tmp/repos-sles15-sp2-current.x86_64.rpm
- yes 2 | zypper in /tmp/repos-sles15-sp2-current.x86_64.rpm
- zypper in /tmp/repos-sles15-sp2-current.x86_64.rpm --force -y
Does anyone know a trick that help with selecting option #2?