LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 01-04-2021, 09:09 PM   #1
lqchoo
LQ Newbie
 
Registered: Jan 2021
Posts: 6

Rep: Reputation: Disabled
How to pre-select solutions (1 or 2) in autoyast xml config file


Hi,
I'm using SLES12sp5. I want to install python3-psutil and have encountered a problem in autoyast.

When I manually execute the zypper command at the prompt "zypper --gpg-auto-import-keys install python3-psutil", I would get the following (truncated) output, with options to select either 1/2/c. If I include the exact same command (with additional -n option) in the auto install xml config file, it would just auto select "c" and skip this zypper install command and move on to the next command I have in my xml file.


Quote:
Building repository 'Python Modules (SLE_12_SP5)' cache .................................................................................................... .[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: nothing provides /usr/bin/python33 needed by python3-psutil-5.7.0-128.5.x86_64
Solution 1: do not install python3-psutil-5.7.0-128.5.x86_64
Solution 2: break python3-psutil-5.7.0-128.5.x86_64 by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/c] (c): 2
Resolving dependencies...
Resolving package dependencies...

The following NEW package is going to be installed:
python3-psutil

The following package has no support information from it's vendor:
python3-psutil

1 new package to install.
Overall download size: 441.0 KiB. Already cached: 0 B. After the operation, additional 2.4 MiB will be used.
Continue? [y/n/...? shows all options] (y): y
So, I would like to find out how should I construct my command in the xml file so that the auto installation process knows my pre-select option (either 1 or 2) for that particular package, and installs it without any user interaction. My codes are all in the init-script section.

Quote:
<scripts>
<init-scripts config:type="list">
<listentry>
<filename>epg_config_setup</filename>
<interpreter>shell</interpreter>
<source><![CDATA[#!/bin/bash
.
.
.
zypper addrepo https://download.opensuse.org/reposi...vel:tools.repo
zypper refresh
zypper --gpg-auto-import-keys -n install meld
zypper mr -d devel_tools

zypper addrepo https://download.opensuse.org/reposi...es:python.repo
zypper --gpg-auto-import-keys -n install python3-psutil
zypper mr -d devel_languages_python

systemctl disable iscsi.service; systemctl stop iscsi.service
systemctl disable iscsid.socket; systemctl stop iscsid.socket
.
.
.
]]></source>
</listentry>
</init-scripts>
</scripts>
Appreciate all the helps I can get here. TIA.
 
Old 01-06-2021, 03:26 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Have you tried zypper with --force-resolution? What option does it choose then?

Last edited by shruggy; 01-06-2021 at 03:40 AM.
 
Old 01-06-2021, 07:20 PM   #3
lqchoo
LQ Newbie
 
Registered: Jan 2021
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for replying. I still get the same behavior after adding --force-resolution. I also tried echoing solution "2", but looks like zypper ignores the echo.

Quote:
# zypper --gpg-auto-import-keys -n install --force-resolution python3-psutil
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: nothing provides /usr/bin/python33 needed by python3-psutil-5.7.0-128.5.x86_64
Solution 1: do not install python3-psutil-5.7.0-128.5.x86_64
Solution 2: break python3-psutil-5.7.0-128.5.x86_64 by ignoring some of its dependencies

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

# zypper --gpg-auto-import-keys install --force-resolution python3-psutil
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: nothing provides /usr/bin/python33 needed by python3-psutil-5.7.0-128.5.x86_64
Solution 1: do not install python3-psutil-5.7.0-128.5.x86_64
Solution 2: break python3-psutil-5.7.0-128.5.x86_64 by ignoring some of its dependencies

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

# echo "2" | zypper --gpg-auto-import-keys install --force-resolution python3-psutil
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: nothing provides /usr/bin/python33 needed by python3-psutil-5.7.0-128.5.x86_64
Solution 1: do not install python3-psutil-5.7.0-128.5.x86_64
Solution 2: break python3-psutil-5.7.0-128.5.x86_64 by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/c] (c): ^C
 
Old 01-07-2021, 07:41 AM   #4
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Rep: Reputation: 16
Have you actually looked at the output of what's going on? You're trying to install a package that has dependencies that are not present in your system. And, it appears that the package's requirements are not "known" by the system, so it can't offer the option to install the required dependencies. You need to fix that FIRST.

THEN, read up on how to set zypper to handle dependencies in the future. Here's the man page for it: https://en.opensuse.org/SDB:Zypper_manual_(plain)
 
Old 01-07-2021, 06:55 PM   #5
lqchoo
LQ Newbie
 
Registered: Jan 2021
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks Ember.
I know I do not need that dependencies. The question here is how to automate it, not to resolve dependencies.
 
Old 01-07-2021, 07:04 PM   #6
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Rep: Reputation: 16
Given that the link I attempted to post is broken (the closing paren is shown, but doesn't come through in the link), I would presume you didn't actually read up on zypper itself.

Ignoring dependencies is not wise as it will likely come back to cause you problems in the future.

If you insist on ignoring it, the correct syntax would be:

Code:
zypper -n <package> --force
Correct link to the page I was trying to reference is: https://en.opensuse.org/SDB:Zypper_manual_(plain)
 
Old 01-07-2021, 08:59 PM   #7
lqchoo
LQ Newbie
 
Registered: Jan 2021
Posts: 6

Original Poster
Rep: Reputation: Disabled
Actually I did look up and read the zypper man page, before I posted this question.

I tried --force option before. It would just select "c" when I run it.

Quote:
# zypper -n install --force python3-psutil
Loading repository data...
Reading installed packages...
Forcing installation of 'python3-psutil-5.7.0-128.5.x86_64' from repository 'Python Modules (SLE_12_SP5)'.
Resolving package dependencies...

Problem: nothing provides /usr/bin/python33 needed by python3-psutil-5.7.0-128.5.x86_64
Solution 1: do not install python3-psutil-5.7.0-128.5.x86_64
Solution 2: break python3-psutil-5.7.0-128.5.x86_64 by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/c] (c): c
For some packages I want to be able to select Solution 1. Like the example below, I want to exclude perl-HTML-TableExtract-2.11-7.8.noarch, perl-HTML-TokeParser-Simple-3.16-3.10.noarch when I install perl. So it's still coming back to the same problem- How I can pre-select the solutions.

Quote:
# zypper -n install perl*
Loading repository data...
Reading installed packages...
.
.
Resolving package dependencies...
2 Problems:
Problem: nothing provides perl(HTML::ElementTable) >= 1.16 needed by perl-HTML-TableExtract-2.11-7.8.noarch
Problem: nothing provides perl(Sub::Override) needed by perl-HTML-TokeParser-Simple-3.16-3.10.noarch

Problem: nothing provides perl(HTML::ElementTable) >= 1.16 needed by perl-HTML-TableExtract-2.11-7.8.noarch
Solution 1: do not install perl-HTML-TableExtract-2.11-7.8.noarch
Solution 2: break perl-HTML-TableExtract-2.11-7.8.noarch by ignoring some of its dependencies
Choose from above solutions by number or skip, retry or cancel [1/2/s/r/c] (c): ^C
The current way of doing it is that I would just simply exclude those zypper cmds that require interaction and run them manually post OS installation. But the process would be so much simpler if this can be automated.
 
Old 01-08-2021, 08:04 AM   #8
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Rep: Reputation: 16
You are trying to create a way to work around required packages - zypper provides only built-in means to work around recommended ones. Things like --force-resolution are intended to tell zypper to find a fix for a problem if one exists, but it defaults to dropping out to interactive mode when it can't.

You've stated that you 'know' you don't need the indicated required package. Why not?
 
Old 01-10-2021, 10:15 PM   #9
lqchoo
LQ Newbie
 
Registered: Jan 2021
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi Ember1205,
The computer I'm installing is intended to be a simple compute server. The reason I want only python3-psutil is because of other another tool "terminator". I can add this manually and the tool would just work fine. I don't need the dependencies pkgs for anything else.
I just want to see if there's possibility of adding this into auto config. Looks like there isn't one, at least for this OS version I guess.
Thanks for all your responses so far.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
libvirt: post virt-clone, unchanged values in resulting XML file from original XML file CptSupermrkt Linux - Virtualization and Cloud 1 04-14-2016 08:20 AM
Bash select lines from xml file elalexluna83 Programming 3 01-03-2013 07:18 PM
autoyast file creation issues AQG SUSE / openSUSE 0 11-28-2007 12:20 PM
LXer: Covalent Technologies and Chariot Solutions Deliver Complete Solutions LXer Syndicated Linux News 0 05-05-2006 09:03 AM
how to select different architectures with autoyast at SuSE 10 squirell SUSE / openSUSE 0 11-02-2005 04:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 04:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration