Bug 483426

Summary: improve the --force option
Product: [openSUSE] openSUSE 11.4 Reporter: Jon Nelson <jnelson-suse>
Component: libzyppAssignee: Jan Kupec <jkupec>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P4 - Low CC: bitdealer, estellnb
Version: Factory   
Target Milestone: Factory   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Jon Nelson 2009-03-09 13:42:12 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.6) Gecko/2009012700 SUSE/3.0.6-0.1.2 Firefox/3.0.6

While trying to help with bug 440101 I had to install a bunch of rpms by hand from factory.  When I was done with that, I tried to revert back to the versions for openSUSE 11.1, using the already-configured repositories for 11.1 (+ Update + a number of others).

zypper in -f libzypp yast2-qt-pkg satsolver-tools yast2-pkg-bindings libqdialogsolver1 zypper yast2-ncurses-pkg aria2 yast2-ncurses yast2-libyui libreadline6
Loading repository data...
Reading installed packages...
Package libzypp-6.2.2-1.1.x86_64 not found in repositories, cannot reinstall.
Package yast2-qt-pkg-2.18.4-1.7.x86_64 not found in repositories, cannot reinstall.
Package satsolver-tools-0.14.0-1.1.x86_64 not found in repositories, cannot reinstall.
Package yast2-pkg-bindings-2.18.2-1.11.x86_64 not found in repositories, cannot reinstall.
Package libqdialogsolver1-1.2.6-1.38.x86_64 not found in repositories, cannot reinstall.
Package zypper-1.1.0-2.1.x86_64 not found in repositories, cannot reinstall.
Package yast2-ncurses-pkg-2.18.1-1.4.x86_64 not found in repositories, cannot reinstall.
Package aria2-1.2.0-2.1.x86_64 not found in repositories, cannot reinstall.
Package yast2-ncurses-2.18.5-1.1.x86_64 not found in repositories, cannot reinstall.
Package yast2-libyui-2.18.6-2.1.x86_64 not found in repositories, cannot reinstall.
Package libreadline6-6.0-4.1.x86_64 not found in repositories, cannot reinstall.
Resolving package dependencies...
Nothing to do.


I don't care if that exact version is available, I want the best-available version.  Even --force-resolution doesn't help here.


Also, how does --repo differ from --from:


-r, --repo <alias|#|URI>        Install packages only from the specified repository.
-t, --type <type>               Type of package (package, patch, pattern, product).
                                Default: package.
-n, --name                      Select packages by plain name, not by capability.
-C, --capability                Select packages by capability.
-f, --force                     Install even if the item is already installed (reinstall).
-l, --auto-agree-with-licenses  Automatically say 'yes' to third party license confirmation prompt.
                                See 'man zypper' for more details.
    --debug-solver              Create solver test case for debugging.
    --no-recommends             Do not install recommended packages, only required.
-R, --no-force-resolution       Do not force the solver to find solution, let it ask.
    --force-resolution          Force the solver to find a solution (even an agressive).
-D, --dry-run                   Test the installation, do not actually install.
    --from <alias|#|URI>        Select packages only from specified repository.



Do you want the generated solver test case?
Otherwise it's probably really easy - grab a package from factory, install it, and then try to get zypper to re-install it using the best-available version.



Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Jan Kupec 2009-03-09 13:53:03 UTC
The name of the --force option is really misfortunate as it is in fact --reinstall-the-exact-installed-version. I'll fix this, but later.

The new functionality still needs to be defined, though. I'll try to come up with some suggestions. What you suggest might be one of the use cases.
Comment 2 Michael Schröder 2009-03-09 13:54:19 UTC
'zypper dup' does excatly what you want: it brings all of your packages back to versions from the configured repositories.
Comment 3 Jan Kupec 2009-03-09 13:58:46 UTC
(In reply to comment #0)
> Also, how does --repo differ from --from:

Please, one report per bug. It is more work for you, but it is also the only sane way to handle bugs. Thanx!

> -r, --repo <alias|#|URI>        Install packages only from the specified
> repository.

The --repo description is wrong. I'll change it to "Consider only the specified repository, ignore others." or something in that fashion. Would that be more clear?

>     --from <alias|#|URI>        Select packages only from specified repository.

This is correct.
Comment 4 Jan Kupec 2009-03-09 14:00:37 UTC
c#2: yes, but it does it for all packages. We need to be able to do it also per-package.

probably 'zypper in -f foo' to reinstall the package with the best available from any repo, and 'zypper in -f -r repo foo' to reinstall from the specified repo.
Comment 5 Jan Kupec 2009-05-25 08:13:57 UTC
*** Bug 506702 has been marked as a duplicate of this bug. ***
Comment 6 Elmar Stellnberger 2009-05-25 10:01:28 UTC
  Providing an own downgrade option as proposed in Enh/Bug 506701 will better fulfill the needs described here as it is anyway possible to downgrade via 'zypper in' by specifying the version (f.i. zypper in libdrm-2.4.1-1.13). In general 'zypper in' should still be for installing packages as it was not meant as a downgrade utility.
Comment 7 Jan Kupec 2010-01-13 14:21:11 UTC
*** Bug 547485 has been marked as a duplicate of this bug. ***
Comment 8 Jon Nelson 2010-09-07 14:48:53 UTC
Agree regarding comment 6. What is the status of this issue?
Comment 9 Jan Kupec 2010-09-07 15:34:34 UTC
(In reply to comment #6)
>   Providing an own downgrade option as proposed in Enh/Bug 506701 will better
> fulfill the needs described here as it is anyway possible to downgrade via
> 'zypper in' by specifying the version (f.i. zypper in libdrm-2.4.1-1.13).

The needs which led Jon to filing this report, yes, but the report itself is about 'zypper in --force ...' not working properly (at least i took it that way). So i'm keeping this open until that is resolved. For the downgrade functionality let's use bug 506701.

> In
> general 'zypper in' should still be for installing packages as it was not meant
> as a downgrade utility.

Why not? It's 'zypper install what-i-tell-you'. If that what-i-tell-you means in fact downgrade, so be it.

(In reply to comment #8)
> What is the status of this issue?

Regarding the --force option, some improvements have been already done in zypper 1.4.x which is now in openSUSE 11.3. I still need to summarize what works and what still needs fixing.
Comment 10 Jan Kupec 2010-09-29 14:28:43 UTC
11.1 -> 11.4
Comment 11 Jan Kupec 2010-10-20 14:09:06 UTC
Fixed in 1.5.1

in -f amarok       # will request the highest ver. regardles
                   # of vendor/priority/locks/dep problems
in -f amarok-1.4.2 # will force that version even if it means downgrade

if the requested/highest version is already installed, it will get reinstalled

Note that 'update' does not have the --force option (yet). But in/up with arguments do the same (just the messages differ a bit). So if you want to force something, use 'in --force'.