Bug 1867376 - Obsoletes doesn't check the version of what will consider obsolete
Summary: Obsoletes doesn't check the version of what will consider obsolete
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 38
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Marek Blaha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-09 11:31 UTC by Sergio Basto
Modified: 2023-11-03 11:10 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-03 11:10:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Sergio Basto 2020-08-09 11:31:28 UTC
Description of problem:
Obsoletes doesn't check version of what is obsoleted 


Version-Release number of selected component (if applicable):

dnf-4.2.23-1.fc31.noarch

How reproducible:

I added [1] to VirtualBox.spec

[1]
Obsoletes:  virtualbox-guest-additions < 6.1.4-1

dnf install virtualbox-guest-additions-0:6.1.10-2.fc31.x86_64 works 

dnf install virtualbox-guest-additions-6.1.10 also works 

but dnf install virtualbox-guest-additions says 

Package VirtualBox-server-6.1.12-2.fc31.x86_64 is already installed.


Expected results:
I expected that virtualbox-guest-additions 6.1.10 would be installed , because is bigger that what VirtualBox-server obsoletes [2]

[2]
rpm -q VirtualBox-server --obsoletes
python2-VirtualBox < 6.1.12-2.fc31
virtualbox-guest-additions < 6.1.4-1



Additional info:

Comment 1 Nicola Sella 2020-08-10 12:41:50 UTC
Hello, the behaviour that you request could be achieved using --best option along with dnf install command, see [1]
I would close it since I think this is expected behaviour. Please, if you experience more issues with this don't hesitate to reopen it.

[1] see --best in https://dnf.readthedocs.io/en/latest/command_ref.html#install-examples

Comment 2 Sergio Basto 2020-08-11 08:35:54 UTC
Hi,
as state , I will reopen this bug .

best option doesn't change nothing this this case 

dnf --best install virtualbox-guest-additions   
Last metadata expiration check: 0:14:45 ago on Tue 11 Aug 2020 09:18:33 AM WEST.
Package VirtualBox-server-6.1.12-2.fc31.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

dnf --best install virtualbox-guest-additions-6.1.10
Last metadata expiration check: 0:15:03 ago on Tue 11 Aug 2020 09:18:33 AM WEST.
Dependencies resolved.
========================================================================================================================================
 Package                                      Architecture             Version                          Repository                 Size
========================================================================================================================================
Installing:
 virtualbox-guest-additions                   x86_64                   6.1.10-2.fc31                    updates                   1.4 M

Transaction Summary
========================================================================================================================================
Install  1 Package

Total download size: 1.4 M
Installed size: 8.1 M

Comment 3 Sergio Basto 2020-08-11 08:41:03 UTC
virtualbox-guest-additions-0:6.1.10-2.fc31.x86_64 is the best package to install 


dnf repoquery virtualbox-guest-additions 
Last metadata expiration check: 0:19:22 ago on Tue 11 Aug 2020 09:18:33 AM WEST.
virtualbox-guest-additions-0:6.0.12-1.fc31.x86_64
virtualbox-guest-additions-0:6.1.10-2.fc31.x86_64

dnf repoquery VirtualBox-server
Last metadata expiration check: 0:19:39 ago on Tue 11 Aug 2020 09:18:33 AM WEST.
VirtualBox-server-0:6.0.14-1.fc31.x86_64
VirtualBox-server-0:6.1.12-1.fc31.x86_64

dnf repoquery --obsoletes VirtualBox-server
Last metadata expiration check: 0:19:58 ago on Tue 11 Aug 2020 09:18:33 AM WEST.
python2-VirtualBox < 6.0.14-1.fc31
python2-VirtualBox < 6.1.12-1.fc31
virtualbox-guest-additions < 6.1.4-1

Comment 4 Ben Cotton 2020-11-03 17:29:33 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2021-02-09 16:25:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 6 Ben Cotton 2022-05-12 16:30:01 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 7 Ben Cotton 2022-06-08 00:47:51 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Sergio Basto 2023-05-13 16:25:42 UTC
see this new example : 
https://bugzilla.rpmfusion.org/show_bug.cgi?id=6667#c14

after
https://src.fedoraproject.org/rpms/gstreamer1-plugins-bad-free/c/e1b9a1129732bf1058e0e43af879d90a9f3ad98e?branch=rawhide
which added  Obsoletes: gstreamer1-plugins-bad-freeworld < 1:1.22.2-2

we build gstreamer1-plugins-bad-freeworld = 1:1.22.2-2 but dnf install gstreamer1-plugins-bad-freeworld doesn't work 
and dnf install "gstreamer1-plugins-bad-freeworld > 1:1.22.2-1"` works

Comment 9 leigh scott 2023-05-19 19:58:08 UTC
This has to be a dnf bug.

$ rpm -qa gstreamer1-plugins-bad-free
gstreamer1-plugins-bad-free-1.22.2-3.fc38.x86_64


$ sudo dnf install gstreamer1-plugins-bad-freeworld
Last metadata expiration check: 0:58:50 ago on Fri 19 May 2023 19:48:23 BST.
Package gstreamer1-plugins-bad-free-1.22.2-3.fc38.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Doing a local install works.

$ sudo dnf download gstreamer1-plugins-bad-freeworld.x86_64
Last metadata expiration check: 1:02:04 ago on Fri 19 May 2023 19:48:23 BST.
gstreamer1-plugins-bad-freeworld-1.22.2-4.fc38.x86_64.rpm

$ sudo dnf install gstreamer1-plugins-bad-freeworld-1.22.2-4.fc38.x86_64.rpm
Last metadata expiration check: 1:02:25 ago on Fri 19 May 2023 19:48:23 BST.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                                           Architecture                            Version                                             Repository                                     Size
===================================================================================================================================================================================================================
Installing:
 gstreamer1-plugins-bad-freeworld                                  x86_64                                  1:1.22.2-4.fc38                                     @commandline                                  219 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total size: 219 k
Installed size: 670 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                           1/1 
  Installing       : gstreamer1-plugins-bad-freeworld-1:1.22.2-4.fc38.x86_64                                                                                                                                   1/1 
  Running scriptlet: gstreamer1-plugins-bad-freeworld-1:1.22.2-4.fc38.x86_64                                                                                                                                   1/1 
  Verifying        : gstreamer1-plugins-bad-freeworld-1:1.22.2-4.fc38.x86_64                                                                                                                                   1/1 

Installed:
  gstreamer1-plugins-bad-freeworld-1:1.22.2-4.fc38.x86_64                                                                                                                                                          

Complete!


dnf5 works.


$ sudo dnf5 install gstreamer1-plugins-bad-freeworld
Updating and loading repositories:
 Fedora 38 - x86_64 - Updates           100% |  14.4 KiB/s |  15.4 KiB |  00m01s
 RPM Fusion for Fedora 38 - Free tainte 100% |  19.4 KiB/s |   6.5 KiB |  00m00s
Repositories loaded.
Package                      Arch   Version                 Repository      Size
Installing:                                                                     
 gstreamer1-plugins-bad-freeworld
                             x86_64 1:1.22.2-4.fc38         rpmfusion- 670.2 KiB

Transaction Summary:
 Installing:        1 packages

Total size of inbound packages is 219 KiB. Need to download 219 KiB.
After this operation 670 KiB will be used (install 670 KiB, remove 0 B).
Is this ok [y/N]: y
[1/1] gstreamer1-plugins-bad-freeworld- 100% | 352.0 KiB/s | 219.3 KiB |  00m01s
--------------------------------------------------------------------------------
[1/1] Total                             100% | 251.5 KiB/s | 219.3 KiB |  00m01s
Verifying PGP signatures

Running transaction
[1/3] Verify package files              100% | 250.0   B/s |   1.0   B |  00m00s
[2/3] Prepare transaction               100% |   0.0   B/s |   1.0   B |  00m02s
[3/3] Installing gstreamer1-plugins-bad 100% | 366.6 KiB/s | 677.1 KiB |  00m02s
>>> Running trigger-install scriptlet: glibc-common-0:2.37-4.fc38.x86_64
>>> Stop trigger-install scriptlet: glibc-common-0:2.37-4.fc38.x86_64

Comment 10 Sergio Basto 2023-05-21 00:23:47 UTC
but with dnf 
 
dnf install gstreamer1-plugins-bad-freeworld
Package gstreamer1-plugins-bad-free-1.22.2-3.fc38.x86_64 is already installed.

but 
dnf install gstreamer1-plugins-bad-freeworld-1:1.22.2-4.fc38.x86_64
Installing:
 gstreamer1-plugins-bad-freeworld         x86_64         1:1.22.2-4.fc38         rpmfusion-free-updates         219 k

Comment 11 Neal Gompa 2023-05-24 10:01:55 UTC
This is not a bug. Obsoletes *do not* affect install requests. Obsoletes exclusively affect upgrades.

Comment 12 Panu Matilainen 2023-05-24 10:15:31 UTC
> Obsoletes *do not* affect install requests. Obsoletes exclusively affect upgrades.

It's not that simple. Rpm refuses to install packages that are obsoleted by an already installed package, or something in the same transaction. 

And dnf should not install obsoleted packages without a manual override of some sort. IIRC that's how yum behaved as well.

Comment 13 Marek Blaha 2023-05-24 10:55:40 UTC
Also when we do not install obsoleter right away, it will most likely get installed in the very next upgrade, which is also confusing for the user. That's basically why we decided to let obsoletes affect also install operation.
Only if the user asks for installation of a specific version, the obsoletes are not taken into account.

Comment 14 Sergio Basto 2023-05-24 11:22:08 UTC
AFAIK dnf5 doesn't have this bug , so is not a problem anymore 

gstreamer1-plugins-bad-free, Obsoletes: gstreamer1-plugins-bad-freeworld < 1:1.22.2-2

base repo (rpmfusion-free) have :  gstreamer1-plugins-bad-free-1.22.2-3.fc38.x86_64 

update repo have : gstreamer1-plugins-bad-freeworld-1:1.22.2-4.fc38.x86_64


dnf install "gstreamer1-plugins-bad-freeworld > 1:1.22.2-1" ,  works

dnf --disablerepo=rpmfusion-free install gstreamer1-plugins-bad-freeworld ,  works 

dnf install gstreamer1-plugins-bad-freeworld , doesn't work says : 
Package gstreamer1-plugins-bad-free-1.22.2-3.fc38.x86_64 is already installed.

Comment 15 Marek Blaha 2023-05-24 11:50:19 UTC
Yes. dnf5 tooks only obsoleters of the latest version of the package into account. So for me also the last example works:

# dnf5 install gstreamer1-plugins-bad-freeworld
Updating and loading repositories:
Repositories loaded.
Package                                Arch          Version                      Repository                              Size
Installing:                                                                                                                                                                       
 gstreamer1-plugins-bad-freeworld      x86_64        1:1.22.2-4.fc38              rpmfusion-free-updates             670.2 KiB

Comment 16 Marek Blaha 2023-11-03 11:10:41 UTC
The solution used in dnf5 was implemented also for dnf4 - see PRs https://github.com/rpm-software-management/dnf/pull/1994 and https://github.com/rpm-software-management/libdnf/pull/1624 so I think the issue is resolved in the latest dnf release.


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