Bug 426607

Summary: "zypper dup" wants to (needlessly?) reinstall lots of packages
Product: [openSUSE] openSUSE 11.2 Reporter: Forgotten User ZhJd0F0L3x <forgotten_ZhJd0F0L3x>
Component: libzyppAssignee: Michael Schröder <mls>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P4 - Low CC: dmacvicar, forgotten_2Xrp_Q7k_A, forgotten_qMyteedNxa, kailed, ma, mrmazda
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: stdout of "zypper dup"
solver test case
tgz of /var/log/zypper.log, /var/log/zypp & /var/log/zypper.solverTestCase

Description Forgotten User ZhJd0F0L3x 2008-09-16 13:34:35 UTC
zypper dup wants to upgrade / downgrade a few packages, and additionally reinstall lots of packages, even though there is no need for that.

(I brought the whole system to latest level by "yast2 sw_single", then "installation summary", "show kept packages", "update all where a newer version is available", so it should already be pretty up to date.

Will attach the stdout of zypper.
Comment 1 Forgotten User ZhJd0F0L3x 2008-09-16 13:35:08 UTC
Created attachment 239829 [details]
stdout of "zypper dup"
Comment 2 Jan Kupec 2008-09-16 13:59:48 UTC
Yes, this is really needlessly. Can you attach also a solver testcase? (rerun with --debug-solver option).
Comment 3 Michael Schröder 2008-09-16 14:13:12 UTC
If the packages are different then they'll get reinstalled. Not a bug IMHO.
Comment 4 Forgotten User ZhJd0F0L3x 2008-09-16 15:03:37 UTC
Created attachment 239851 [details]
solver test case

Of course. Here it is.
Comment 5 Forgotten User ZhJd0F0L3x 2008-09-16 15:05:01 UTC
I don't think the packages are different. I get this after a "zypper dup" has finished, if I run it again, it wants to reinstall almost everything. Even if the repository did not change.
Comment 6 Michael Schröder 2008-09-16 16:44:28 UTC
The testcase says that the build times are different, e.g. installed zsh has build time Sep 14 15:56:32, repo zsh has Sep 15 05:30:55. Factory rebuilds a lot...
Comment 7 Jan Kupec 2008-09-16 17:35:45 UTC
i hope i won't have to show this in the install summary as well :O))) If this is really intended and needed, can't factory avoid rebuilding unchanged packages?
Comment 8 Michael Schröder 2008-09-16 17:49:45 UTC
Heh, things will change soon. When factory is no longer built by autobuild and exclusively in the build service, package release numbers will be of the form "ci count"."rebuild count". So zypper will see a higher release will every rebuild and report hundreds of updates instead of hundreds of reinstalls.
Comment 9 Forgotten User ZhJd0F0L3x 2008-09-16 17:52:51 UTC
superb! ;-)
Would a "--no-buildtime-check" option for zypper be possible?
Comment 10 Forgotten User qMyteedNxa 2008-10-12 09:52:07 UTC
here`s a "me too" - i had run zypper dup upgrade for hours yesterday - zypper needed to install around 1136 (925mb) of packages. because it was darn late, i suspended the vm (test system only) and hoped, zypper would continue after resume - ok, it didn`t - but after restarting "zypper dup", zypper starts from scratch and installes all of them again. very weird - how can zypper install an rpm without warning, if it`s already there? i checked the repo, but all packages are same version as yesterday.
Comment 11 Felix Miata 2008-11-21 02:48:19 UTC
Created attachment 254154 [details]
tgz of /var/log/zypper.log, /var/log/zypp & /var/log/zypper.solverTestCase

I can repeat 'zypper dup' as many times in succession as I want, and always when the latest kernel is already installed it will downgrade openSUSE, and reinstall kernel-pae, kernel-pae-base & openSUSE-release.
Comment 12 Duncan Mac-Vicar 2008-11-21 11:00:27 UTC
comment #10: are you by chance using zypper shell there?
Comment 13 Forgotten User ZhJd0F0L3x 2008-11-21 12:09:41 UTC
I am not using zypper at all for updates due to this bug.
Comment 14 Jan Kupec 2008-11-21 16:31:13 UTC
The logs suggests 'zypper shell' was not used.
Comment 15 Forgotten User 2Xrp_Q7k_A 2009-02-04 13:31:58 UTC
another "me too". On each run zypper wants to reinstall some packages from Packman where their rpm buildtime is not the same than the ones listed in the xml files that I get with --debug-solver. *Very* annoying. This is on 11.1 btw, w/o factory packages.

I can add the resolver testcase, but it's the situation mentioned above already.
Oh yes, and there's also bug 472099 that's probably a duplicate to this one.

Can we please get the option "--no-buildtime-check"?

In addition, please give us a "--explain" option (or add this to some verbosity level) that gives for each installed, upgraded, or reinstalled package the reason why this action has been taken. (more current, new dependency, buildtime changed, etc.) It took me a full hour to track down the root cause behind that obnoxiuos behaviour, and such an option would make our lives really easier, IMHO.
Comment 16 Michael Andres 2009-02-04 16:30:34 UTC
*** Bug 472099 has been marked as a duplicate of this bug. ***
Comment 17 Michael Andres 2009-02-04 16:35:01 UTC
Fisrt step would be a solver option to turn off buildtime-check.
Comment 18 Michael Schröder 2009-02-16 20:12:47 UTC
No, "zypper dup" means "make the installed packages identical to the ones from the repositories". If the build times are different, the packages are not identical. Of course this only works if the repositories aren't broken, somebody should notify the packman guys of this.

"zypper up" is a different beast, it doesn't look at the build time. You should use 'up' instead of 'dup' to keep your packages up to date.
Comment 19 Forgotten User 2Xrp_Q7k_A 2009-02-16 20:49:23 UTC
I think meanwhile all here understood that the behaviour was caused by a bad meta info in a package. (I notified the Packman guys and they repaired it some time ago.) Owing to the bad accessibility of respective data, it just took us a while to get to that conclusion.

But that's not the issue at hand. We asked for an *enhancement* of zypper to allow us to handle corrupt repositories better, in a more flexible fashion. After all, one is usually not in the situation to fix the root cause of that problem since we don't own the repositories and thus one needs both robust and flexible behaviour here. Since one very often has dozens of repository, such corruptness can happen again, and added robustness would make zypper better in that case.

Simply saying "works as designed" takes away the opportunity to use our user feedback to improve your software, which is a very sad attitude.
Comment 20 Michael Schröder 2009-02-16 21:19:20 UTC
You really shouldn't use 'zypper dup' to keep your packages up to date. It's not designed for that purpose.
Comment 21 Forgotten User 2Xrp_Q7k_A 2009-02-17 10:16:22 UTC
zypper up may not be designed, but since zypper up ignores repo priorities since 11.1, it's not fit for my purpose either. In fact, since 11.1, 'zypper dup' does a better job for my intentions, namely to give jpackage and Packman packages always priorities over SUSE ones.
Comment 22 Michael Schröder 2009-02-17 11:32:37 UTC
Zypper up does not ignore repo priorities. You're probably hit by the vendor locking, just configure zypp so that packman is considered equal to the opensuse vendor.

I.e., create a file /etc/zypp/vendors.d/packman that contains:

[main]
vendors = packman,suse,opensuse