Bug 2226652

Summary: dnf5 cannot update packages from local disk (dnf update */dnf update pkg1.rpm pkg2.rpm ...)
Product: [Fedora] Fedora Reporter: Martin Osvald 🛹 <mosvald>
Component: dnf5Assignee: rpm-software-management
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: amatej, jkolarik, nsella, pkratoch, rpm-software-management
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-26 06:56:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Osvald 🛹 2023-07-26 06:11:24 UTC
If you try to update packages from the local disk to a newer version, it fails with no error / "Nothing to do." msg.

Reproducible: Always

Steps to Reproduce:
1. Have some older version of some pkg installed
2. Have a newer one present on disk and then do:

# dnf update pkg1 pkg2 ...

or 

# dnf update *
Actual Results:  
This is not working with dnf5 on f39/rawhide (dnf5-5.1.0-2.fc39.x86_64):

I have some packages installed:

~~~
# rpm -qa | egrep "cyrus-imapd|perl-Cyrus"
perl-Cyrus-3.6.0-9.fc39.x86_64
cyrus-imapd-libs-3.6.0-9.fc39.x86_64
cyrus-imapd-utils-3.6.0-9.fc39.x86_64
cyrus-imapd-3.6.0-9.fc39.x86_64
#
~~~

and I want to update it with a newer version which I built locally:

1. It does nothing reporting "Nothing to do.":

~~~
# dnf update cyrus-imapd-3.8.0-2.fc39.x86_64.rpm cyrus-imapd-libs-3.8.0-2.fc39.x86_64.rpm cyrus-imapd-utils-3.8.0-2.fc39.x86_64.rpm perl-Cyrus-3.8.0-2.fc39.x86_64.rpm
Updating and loading repositories:
Repositories loaded.
Nothing to do.
#
~~~

2. If I try to use "*" to update the one installed it again does nothing reporting "Nothing to do.":

~~~
# dnf update *
Updating and loading repositories:
Repositories loaded.
Packages for argument 'cyrus-imapd-debuginfo-3.8.0-2.fc39.x86_64' available, but not installed.
Packages for argument 'cyrus-imapd-debugsource-3.8.0-2.fc39.x86_64' available, but not installed.
Packages for argument 'cyrus-imapd-devel-3.8.0-2.fc39.x86_64' available, but not installed.
Packages for argument 'cyrus-imapd-libs-debuginfo-3.8.0-2.fc39.x86_64' available, but not installed.
Packages for argument 'cyrus-imapd-utils-debuginfo-3.8.0-2.fc39.x86_64' available, but not installed.
Packages for argument 'cyrus-imapd-virusscan-3.8.0-2.fc39.x86_64' available, but not installed.
Packages for argument 'cyrus-imapd-virusscan-debuginfo-3.8.0-2.fc39.x86_64' available, but not installed.
Packages for argument 'perl-Cyrus-debuginfo-3.8.0-2.fc39.x86_64' available, but not installed.

Nothing to do.
#
~~~

Expected Results:  
This is working fine with dnf4 on f38 (dnf-4.16.1-1.fc38.noarch):

1.

~~~
# dnf update cyrus-imapd-3.8.0-2.fc38.x86_64.rpm cyrus-imapd-libs-3.8.0-2.fc38.x86_64.rpm cyrus-imapd-utils-3.8.0-2.fc38.x86_64.rpm perl-Cyrus-3.8.0-2.fc38.x86_64.rpm
Last metadata expiration check: 0:08:35 ago on Wed 26 Jul 2023 01:49:38 AM EDT.
Dependencies resolved.
=========================================================================================================
 Package                      Architecture      Version                    Repository               Size
=========================================================================================================
Upgrading:
 cyrus-imapd                  x86_64            3.8.0-2.fc38               @commandline            1.6 M
 cyrus-imapd-libs             x86_64            3.8.0-2.fc38               @commandline            891 k
 cyrus-imapd-utils            x86_64            3.8.0-2.fc38               @commandline             72 k
 perl-Cyrus                   x86_64            3.8.0-2.fc38               @commandline            263 k

Transaction Summary
=========================================================================================================
Upgrade  4 Packages

Total size: 2.8 M
Is this ok [y/N]:
~~~

2.

~~~
# dnf update *
Last metadata expiration check: 0:09:11 ago on Wed 26 Jul 2023 01:49:38 AM EDT.
Package cyrus-imapd-debuginfo not installed, cannot update it.
No match for argument: cyrus-imapd-debuginfo-3.8.0-2.fc38.x86_64.rpm
Package cyrus-imapd-debugsource not installed, cannot update it.
No match for argument: cyrus-imapd-debugsource-3.8.0-2.fc38.x86_64.rpm
Package cyrus-imapd-devel not installed, cannot update it.
No match for argument: cyrus-imapd-devel-3.8.0-2.fc38.x86_64.rpm
Package cyrus-imapd-libs-debuginfo not installed, cannot update it.
No match for argument: cyrus-imapd-libs-debuginfo-3.8.0-2.fc38.x86_64.rpm
Package cyrus-imapd-utils-debuginfo not installed, cannot update it.
No match for argument: cyrus-imapd-utils-debuginfo-3.8.0-2.fc38.x86_64.rpm
Package cyrus-imapd-virusscan not installed, cannot update it.
No match for argument: cyrus-imapd-virusscan-3.8.0-2.fc38.x86_64.rpm
Package cyrus-imapd-virusscan-debuginfo not installed, cannot update it.
No match for argument: cyrus-imapd-virusscan-debuginfo-3.8.0-2.fc38.x86_64.rpm
Package perl-Cyrus-debuginfo not installed, cannot update it.
No match for argument: perl-Cyrus-debuginfo-3.8.0-2.fc38.x86_64.rpm
Dependencies resolved.
=========================================================================================================
 Package                      Architecture      Version                    Repository               Size
=========================================================================================================
Upgrading:
 cyrus-imapd                  x86_64            3.8.0-2.fc38               @commandline            1.6 M
 cyrus-imapd-libs             x86_64            3.8.0-2.fc38               @commandline            891 k
 cyrus-imapd-utils            x86_64            3.8.0-2.fc38               @commandline             72 k
 perl-Cyrus                   x86_64            3.8.0-2.fc38               @commandline            263 k

Transaction Summary
=========================================================================================================
Upgrade  4 Packages

Total size: 2.8 M
Is this ok [y/N]:
~~~

Workaround:

~~~
# rpm -Uvh *
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:cyrus-imapd-debugsource-3.8.0-2.f################################# [  6%]
   2:cyrus-imapd-debuginfo-3.8.0-2.fc3################################# [ 13%]
   3:cyrus-imapd-libs-3.8.0-2.fc39    ################################# [ 19%]
   4:perl-Cyrus-3.8.0-2.fc39          ################################# [ 25%]
   5:cyrus-imapd-utils-3.8.0-2.fc39   ################################# [ 31%]
   6:cyrus-imapd-3.8.0-2.fc39         ################################# [ 38%]
   7:cyrus-imapd-devel-3.8.0-2.fc39   ################################# [ 44%]
   8:cyrus-imapd-virusscan-3.8.0-2.fc3################################# [ 50%]
   9:cyrus-imapd-libs-debuginfo-3.8.0-################################# [ 56%]
  10:cyrus-imapd-utils-debuginfo-3.8.0################################# [ 63%]
  11:cyrus-imapd-virusscan-debuginfo-3################################# [ 69%]
  12:perl-Cyrus-debuginfo-3.8.0-2.fc39################################# [ 75%]
Cleaning up / removing...
  13:cyrus-imapd-3.6.0-9.fc39         ################################# [ 81%]
  14:cyrus-imapd-utils-3.6.0-9.fc39   ################################# [ 88%]
  15:cyrus-imapd-libs-3.6.0-9.fc39    ################################# [ 94%]
  16:perl-Cyrus-3.6.0-9.fc39          ################################# [100%]
#
~~~

Comment 1 amatej 2023-07-26 06:56:16 UTC
I think this is because of the switch of `allow_vendor_change` default configuration to false.
Your locally build packages likely have a different vendor than those installed from fedora.

This has since been reverted: https://github.com/rpm-software-management/dnf5/pull/745
It should start working again once released.

In the meantime you can do `--setopt=allow_vendor_change=true` to workaround it.

*** This bug has been marked as a duplicate of bug 2219624 ***