Bug 34085 - urpmi --downgrade fails if no lower version in update media
Summary: urpmi --downgrade fails if no lower version in update media
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-12 10:26 CET by Morgan Leijström
Modified: 2025-03-13 19:19 CET (History)
1 user (show)

See Also:
Source RPM: urpmi-8.131-1.mga9
CVE:
Status comment:


Attachments

Description Morgan Leijström 2025-03-12 10:26:06 CET
Description of problem:

urpmi --help say:
 --downgrade    - downgrade a package from the version currently installed
                   to the previously highest version
But it do not always work.

Version-Release number of selected component (if applicable):
urpmi-8.131-1.mga9

How reproducible:
Easy currently: try "urpmi --downgrade lib64event7" and see it fail.
Add " --media "Core Release" and it succeed.
From https://forums.mageia.org/en/viewtopic.php?t=15613&#p91122

Steps to Reproduce:
1. Package installed is from updates repo. 
2. There is no lower version in updates repo.
3. There is a lower version in release repo.
4. "urpmi --downgrade thatpackage" then tries to downgrade to the version installed.
Comment 1 katnatek 2025-03-12 16:57:16 CET
(In reply to Morgan Leijström from comment #0)
> Description of problem:
> 
> urpmi --help say:
>  --downgrade    - downgrade a package from the version currently installed
>                    to the previously highest version
> But it do not always work.
> 
> Version-Release number of selected component (if applicable):
> urpmi-8.131-1.mga9
> 
> How reproducible:
> Easy currently: try "urpmi --downgrade lib64event7" and see it fail.
> Add " --media "Core Release" and it succeed.
> From https://forums.mageia.org/en/viewtopic.php?t=15613&#p91122
> 
> Steps to Reproduce:
> 1. Package installed is from updates repo. 
> 2. There is no lower version in updates repo.
> 3. There is a lower version in release repo.
> 4. "urpmi --downgrade thatpackage" then tries to downgrade to the version
> installed.

You can explicit downgrade to "good" version or disable updates media

urpmi --downgrade lib64event7-2.1.12-4.mga9

or

urpmi --downgrade lib64event7 --media "Core Release"
Comment 2 katnatek 2025-03-12 17:00:20 CET
LC_ALL=C urpmi --downgrade lib64event7-2.1.12-4.mga9 --test
The following package has to be removed for others to be upgraded:
lib64event7-2.1.12-4.1.mga9.x86_64
 (in order to install lib64event7-2.1.12-4.mga9.x86_64)
(test only, removal will not be actually done) (y/N) y


installing lib64event7-2.1.12-4.mga9.x86_64.rpm from /mnt/DVD/x86_64/media/core
Preparing...                     ##################################################################################################
Installation is possible


LC_ALL=C urpmi --downgrade lib64event7 --media "Core Release" --test
The following package has to be removed for others to be upgraded:
lib64event7-2.1.12-4.1.mga9.x86_64
 (in order to install lib64event7-2.1.12-4.mga9.x86_64)
(test only, removal will not be actually done) (y/N) y


    https://mirror.math.princeton.edu/pub/mageia/distrib/9/x86_64/media/core/release/lib64event7-2.1.12-4.mga9.x86_64.rpm
installing lib64event7-2.1.12-4.mga9.x86_64.rpm from /var/cache/urpmi/rpms                                                          
Preparing...                     ##################################################################################################
Installation is possible
Comment 3 Morgan Leijström 2025-03-12 17:17:35 CET
This bug is that urpmi sometimes fail selecting previous version by itself as it is intended to by the help instruction.
Florian Hubold 2025-03-12 17:39:26 CET

CC: (none) => doktor5000

Comment 4 katnatek 2025-03-12 22:41:22 CET
For me is working but is not as smart as must 
Its necessary disable or limit repositories https://bugs.mageia.org/show_bug.cgi?id=32333#c5

I think a --release option that allow to only search packages in release media could help in this cases
Comment 5 Morgan Leijström 2025-03-13 16:47:06 CET
I think the best would be to make it work per its own help file:
  "downgrade a package from the version currently installed
   to the previously highest version"

I think DNF works this way.

I believe it is a bug, is not working as intended, lets fix that and not invent another way.
Comment 6 katnatek 2025-03-13 17:38:39 CET
(In reply to Morgan Leijström from comment #5)
> I think the best would be to make it work per its own help file:
>   "downgrade a package from the version currently installed
>    to the previously highest version"
> 
> I think DNF works this way.
> 
> I believe it is a bug, is not working as intended, lets fix that and not
> invent another way.

Just to previous version could be bad idea, what if you need to downgrade to several versions? What do you think is the easiest? run downgrade command several times or directly downgrade to the version you want?

The last method is what joselp and I did use to get the last "good" version for  
bug#3324

I think the manual need tweak,  need to explain that is needed to disable the repository where the "bad" version is, limit to the repository where the "good" version is, or put the exact version 

I note that  --downgrade install the current version if you not disable the repository where the new version is (like is reported)
Comment 7 Morgan Leijström 2025-03-13 17:43:07 CET
I usually specify version or repo and that works great.
But that does not matter:
This bug us about urpmi not working as intended.
Or at least not per its own help.
So either change the help or make it work.
Comment 8 katnatek 2025-03-13 19:19:58 CET
(In reply to Morgan Leijström from comment #7)
> I usually specify version or repo and that works great.
> But that does not matter:
> This bug us about urpmi not working as intended.
> Or at least not per its own help.
> So either change the help or make it work.

I just think the first is more easy ;)

Note You need to log in before you can comment on or make changes to this bug.