[opensuse-autoinstall] OpenSUSE 11.0: Truly non-interactive "zypper update"?
Hi, Ist there a non-documented truly non-interactive option of zypper? I need to run it from an Autoyast postinstall script to perform updates after we have localized the software repositories. The code I use for this to perform is: ==CUT== # Package repositories after installation zypper repos -d # Delete all repositories ... repositories=`zypper repos | awk '($1~/^[0-9]+$/){print $1}'` zypper removerepo $repositories # Set install server as package repository ... zypper addrepo http://$INSTSRV/suse/11.0 "openSUSE 11.0 DVD" zypper addrepo http://$INSTSRV/suse/opensuse-updates/11.0 "openSUSE 11.0 Updates" zypper modifyrepo -r "openSUSE 11.0 Updates" zypper refresh -f zypper repos -d # One of installed patches affects the package manager itself # Therefore we must run it at least twice. Somehow the RPM database is # corrupt rebuild it or the list of available updates does not match. cd /tmp for (( i=1; i<=2; i++ )); do echo "Updating system (run $i) ..." zypper -n verify zypper -n list-updates zypper -n update --skip-interactive --auto-agree-with-licenses --force-resolution echo "Rebuilding RPM database ..." rpm --rebuilddb -v done ==CUT== The option "--force-resolution" had to be added because there was once a smbclient patch that hindered an online update and asked to confirm to delete smbclient due to a serious bug. Now there has another patch appeared and that option aborts online update completely. Output from /var/adm/autoinstall/logs/i250swupdate.log: ==CUT== + zypper -n list-updates Reading installed packages... Patches Warning: These are only the updates affecting the updater itself. Other updates are available too. Repository | Name | Version | Category | Status ----------------------+--------------+---------+-------------+------- openSUSE 11.0 Updates | softwaremgmt | 365 | recommended | Needed openSUSE 11.0 Updates | softwaremgmt | 462 | recommended | Needed + zypper -n update --skip-interactive --auto-agree-with-licenses --force-resolution Reading installed packages... Problem: cannot install both patch:softwaremgmt-462.noarch and patch:softwaremgmt-365.noarch Solution 1: do not install patch:softwaremgmt-462.noarch Solution 2: do not install patch:softwaremgmt-365.noarch Choose from above solutions by number or cancel [1/2/C]: c ==CUT== Isn't there an option that just does the right thing and updates all packages to the latest release? Thanks in advance. Best regards, Bernd -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Have you tried first to patch the system and then do any updates ? Its looks to me that zypper behaves different on updates and patches. Thus you check for updates but zypper shows patches. Maybe a bug ?
+ zypper -n list-updates Reading installed packages... ------> Patches
Warning: These are only the updates affecting the updater itself. Other updates are available too.
Repository | Name | Version | Category | Status ----------------------+--------------+---------+-------------+------- openSUSE 11.0 Updates | softwaremgmt | 365 | recommended | Needed openSUSE 11.0 Updates | softwaremgmt | 462 | recommended | Needed + zypper -n update --skip-interactive --auto-agree-with-licenses -- force-resolution Reading installed packages...
-------> Problem: cannot install both patch:softwaremgmt-462.noarch and
patch:softwaremgmt-365.noarch Solution 1: do not install patch:softwaremgmt-462.noarch Solution 2: do not install patch:softwaremgmt-365.noarch
Thus first apply patches and then update $ zypper patch .... then $ zyper update .... hth Hajo
Hi, Hans-Joachim Ehlers wrote:
Have you tried first to patch the system and then do any updates ? Its looks to me that zypper behaves different on updates and patches. Thus you check for updates but zypper shows patches. Maybe a bug ?
Thus first apply patches and then update $ zypper patch ....
then
$ zyper update ....
According to zypper manpage the 'update' command updates the current packages with patches: list-updates (lu) [options] List available updates. -t, --type <type> Type of package (default: patch). See the beginning of this subsection for the list of available package types. -r, --repo <alias|#|URI> List only updates from the repository specified by the alias, number or URI. This option can be used multiple times. See also the NOTE at update. update (up) [options] [packagename] ... Update installed packages with patches or newer version, where applicable. To update individual packages, specify one or more package names. You can use the '*' and '?' wildcard characters in the package names to specify multiple packages matching the pat‐ tern. NOTE: Zypper prefers to update only those packages for which a patch description exists, like on the SUSE update servers. To operate on all packages for which there is a better ver‐ sion instead, select --type package which is also the default in rug compatibility mode. There is no such command like "zypper patch" only "zypper patches" which lists installed and available patches. Bye, Bernd -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Sorry. I looked at the OS 11.1 version.
There is no such command like "zypper patch" only "zypper patches" which lists installed and available patches.
Thus the question arise whether or not it is allowed for a update repository to have more then 1 version of a patch as shown by you
openSUSE 11.0 Updates | softwaremgmt | 365 | recommended | Needed openSUSE 11.0 Updates | softwaremgmt | 462 | recommended | Needed
have a nice weekend Hajo
Hans-Joachim Ehlers wrote:
Sorry. I looked at the OS 11.1 version.
There is no such command like "zypper patch" only "zypper patches" which lists installed and available patches.
Thus the question arise whether or not it is allowed for a update repository to have more then 1 version of a patch as shown by you
openSUSE 11.0 Updates | softwaremgmt | 365 | recommended | Needed openSUSE 11.0 Updates | softwaremgmt | 462 | recommended | Needed
That is what I already could understand from the zypper output and posted in the first message. My question is why isn't there an option that just applies the latest version of a patch without user intervention instead of aborting the entire update process. We need this to do this after installing some hundred systems with Autoyast and an unpatched openSUSE 11.0 system is too buggy and unusable for our purposes as office desktop. I cannot rollout opensuse 11.1 now and annoy our users because we just had migrated from 10.3 to 11.0 some months ago. Bye Bernd -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (2)
-
Bernd Nies
-
Hans-Joachim Ehlers