Bug 506701

Summary: offer a distro downgrade option for zypper/YaST2
Product: [openSUSE] openSUSE 11.1 Reporter: Elmar Stellnberger <estellnb>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P4 - Low CC: dmacvicar
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Elmar Stellnberger 2009-05-23 09:47:15 UTC
User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) SUSE

  By now zypper only offers two options for installing new software: in & dup.
My request would be to supplement dup with a ddn-option (distribution downgrade). It just happens quite often that one has to remove all the packages just installed via dup from the buildservice because they do not work properly. As zypper does not offer an undo function providing ddn would probably be the only way to achieve this. It could do something like the follwing commands:

 zypper in -f $( grep '|X11-Xorg|' /var/log/zypp/history | grep 'install' | cut -f 3 -d '|')  2>&1 | tee /dev/stderr | grep "not found in repositories"| cut -f 2 -d " " >todel
zypper rm $(cat todel)

i.e. downgrade all packages of X11-Xorg that are available fromout of another source; remove all other packages
(although this time I had to use Yast manually to do this because zypper has complained about a lot of packages not being available which could in deed be downgraded via Yast after disabling the X11-Xorg repo.)


Reproducible: Always
Comment 1 Elmar Stellnberger 2009-05-23 10:00:16 UTC
See Bug 506701 for a basic problem description this enhancement is meant to solve.
Comment 2 Duncan Mac-Vicar 2009-05-23 16:59:01 UTC
Why you just don't do a dup with the repository with the new Xorg packages disabled?
Comment 3 Elmar Stellnberger 2009-05-23 18:39:36 UTC
  Basically I could try it with a dup on repo-oss, at least if all affected packages were not distributed over different repos. 
  ... but that would downgrade all packages offered by repo-oss which is definitely not what I want.
  f.i. having installed X11:/XOrg an doing a dup on repo-oss would downgrade all my Packman packages as well. Letting a dup on Packman follow is as well definitely something I do not want because I do only prefer certain packages distributed by Packman over their Opensuse counterpart (To me dup is just a sledgehammer and is therefore only useful with small repos for a specific application like those provided by the buildservice).
Comment 4 Elmar Stellnberger 2009-07-08 11:23:31 UTC
Perhaps also worth to be taken in consideration for os11.2/Openfate.
Comment 5 Michael Andres 2010-08-04 11:55:45 UTC
11.2 has 'zypper dup --from <repo>' to perform dup on a specific repo only.
Comment 6 Elmar Stellnberger 2010-08-08 10:10:15 UTC
No. This is not what I have been asking for.
  I have been asking for an "undo" which completely drops a certain repository so that no more packages from this repo remain installed. 
  In detail this means that zypper will have to look for all packages currently installed from the offending repo and look which repos offer alternative packages (possibly multiple other repos - no zypper dup --from). If no other repo can provide an alternative the given package needs to be uninstalled.
Comment 7 Jan Kupec 2010-08-24 13:04:32 UTC
(In reply to comment #0)
> As zypper does not offer an undo function providing ddn would probably be the
> only way to achieve this.

Not really. IMO it would be much more worth to invest in implementation of proper undo/rollback function instead of this (it's not that easy to do anyway). The rollback is even planned and will have higher priority, so let's focus on that.

One more thing comes to my mind: why not enable "keeppackages" for all repos and create a snapshot (hardlink all /var/cache/zypp/packages files recursively to some dir) and use this snapshot as a repository to go back to using 'zypper dup --repo snapshot' with solver.upgradeRemoveDroppedPackages = true. This could be even one way of doing real rollback...
Comment 8 Jan Kupec 2010-09-07 15:27:04 UTC
(In reply to comment #2)
> Why you just don't do a dup with the repository with the new Xorg packages
> disabled?

Because that would that would trigger upgrade/downgrade of all packages, not just those from the repository you want to get rid of. That's something you want to avoid in this case.
Comment 9 Elmar Stellnberger 2010-12-14 18:31:27 UTC
 In consecution to Comment #6: Once again having run into needing such a feature my idea is to do the following: Disable the offending repo. Query all packages installed from that repo (by an own python program of mine), uninstalling and reinstalling them as kept in a package list file. That should help. 
  I hope.
(breamfishing around with vim and elinks because a zypper dup of Xorg has once more broken my X.)
Comment 10 Duncan Mac-Vicar 2011-05-17 14:45:47 UTC
We accept patches for this, but we will not implement it ourselves. For a more generic undo functionality, wait for snapper in Factory.