Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1824728[details]
Makefile & spec files to make and install/uprade example rpm's.
Description of problem:
When the currently-installed package has a specific architecure (it-1.0-1.x86_64), and a command like the following is specified:
dnf upgrade it-2.0-1.noarch.rpm
Then the upgrade fails. If the same package were specified by package name and downloaded from a repo, it would work.
Version-Release number of selected component (if applicable):
Observed in 4.0.9 (CentOS 8.2), 4.4.2 (f29), 4.8.0 (f34).
How reproducible:
Always.
Steps to Reproduce:
1. rpm -ivh it-1.0-1.x86_64.rpm
2. dnf upgrade it-2.0-1.noarch.rpm
Actual results:
Package it not installed, cannot update it.
No match for argument: it-2.0-1.noarch.rpm
Error: No packages marked for upgrade.
Expected results:
The upgrade should happen.
Additional info:
See the attachment for an example of this. Just run "make". It will construct
two "it" packages, install the first one, and then attempt to upgrade to the
second.
I discovered this while working on a GUI that makes use of the dnf.Base API.
It was using the dnf.Base.package_upgrade function for all upgrades. But the
dnf command-line interface uses the dnf.Base.upgrade function for
upgrades-by-package-name, and only uses the dnf.Base.package_upgrade function
for upgrades-by-filename.
dnf.Base.package_upgrade is where the problem exists. And this is why it only
appears in the relatively rare upgrade-by-filename. Anyway, it makes a call to:
q = self.sack.query().installed().filterm(name=pkg.name, arch=[pkg.arch, "noarch"])
The pkg in this case is the "new" package (e.g. it-2.0-1.noarch), so the arch
parameter ends up being ['noarch', 'noarch']. But neither of those is 'x86_64'.
(It's interesting that there's an explicit mention of 'noarch' here. Clearly
the writer of this code was thinking of noarch->x86_64 upgrades, but not the
other way around.)
I suspect that, for an upgrade to 'noarch', this needs to do a more "vague"
lookup to find all packages with the given name.
Hello, I see that you run `dnf upgrade it-2.0-1.noarch.rpm`. Is this a typo? This is not correct for dnf upgrade.
Dnf supports installing/updating from a local rpm, but does not work if the file is not in the path: you should provide just the package name, like `dnf upgrade it-2.0-1.noarch`.
Please, could you try with `dnf upgrade it-2.0-1.noarch`? Thank you
That is not a typo, and the command is accepted. It just fails for the reasons outlined.
In that example, it-2.0-1.noarch.rpm is a local rpm, as you can deduce from the ".rpm" on the end.
Trying with the command you suggested would be doomed to failure because the rpm is not in a repo.
I bothered to create a self-contained example attached. Just try it.
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.
I guess that the problem is related to the query on line 2131 of base.py `q = installed.filter(name=pkg.name, arch=[pkg.arch, "noarch"])`
May be we can make `arch` optional filter if `pkg.name == "noarch"`. What do you think?
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (dnf bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2023:2980
Created attachment 1824728 [details] Makefile & spec files to make and install/uprade example rpm's. Description of problem: When the currently-installed package has a specific architecure (it-1.0-1.x86_64), and a command like the following is specified: dnf upgrade it-2.0-1.noarch.rpm Then the upgrade fails. If the same package were specified by package name and downloaded from a repo, it would work. Version-Release number of selected component (if applicable): Observed in 4.0.9 (CentOS 8.2), 4.4.2 (f29), 4.8.0 (f34). How reproducible: Always. Steps to Reproduce: 1. rpm -ivh it-1.0-1.x86_64.rpm 2. dnf upgrade it-2.0-1.noarch.rpm Actual results: Package it not installed, cannot update it. No match for argument: it-2.0-1.noarch.rpm Error: No packages marked for upgrade. Expected results: The upgrade should happen. Additional info: See the attachment for an example of this. Just run "make". It will construct two "it" packages, install the first one, and then attempt to upgrade to the second. I discovered this while working on a GUI that makes use of the dnf.Base API. It was using the dnf.Base.package_upgrade function for all upgrades. But the dnf command-line interface uses the dnf.Base.upgrade function for upgrades-by-package-name, and only uses the dnf.Base.package_upgrade function for upgrades-by-filename. dnf.Base.package_upgrade is where the problem exists. And this is why it only appears in the relatively rare upgrade-by-filename. Anyway, it makes a call to: q = self.sack.query().installed().filterm(name=pkg.name, arch=[pkg.arch, "noarch"]) The pkg in this case is the "new" package (e.g. it-2.0-1.noarch), so the arch parameter ends up being ['noarch', 'noarch']. But neither of those is 'x86_64'. (It's interesting that there's an explicit mention of 'noarch' here. Clearly the writer of this code was thinking of noarch->x86_64 upgrades, but not the other way around.) I suspect that, for an upgrade to 'noarch', this needs to do a more "vague" lookup to find all packages with the given name.