-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnf info --releasever=XX
ignores releasever
when package is installed
#1975
Comments
I think what you are looking for is "--available" option which limits searching among repositories, i.e. not among installed packages:
The thing is that "dnf info" actually searches among repositories and installed packages by default, but hides older versions (unless --showduplicates is given). And thus it depends which package version is newer and which is older. Observe how the section name changes between "Installed packages" and "Available packages":
The same applies to DNF4. Except there is actually a bug in DNF4 which prevents from listing any version from repositories if a newer one is installed:
While it works with DNF5:
In other words, the difference you reported is a difference between F40 and F41 systems where you have installed different package versions. It's not a change between DNF4 and DNF5. |
I forgot to paste how DNF4 behaves:
As you can see in the latest command, DNF4 also hides available packages if they are older than the installed one. I also find the asymmetry strange, but at least it's not regression comparing to DNF4. I wouldn't be surprised if it were a feature. I will ask veteran DNF developers for the explanation, and we will either document it properly in dnf5-info manual, or change the behavior. |
Thanks for the explanation.
I'm not sure if the varying output depending on the situation is ideal, but then again I hadn't really noticed it until now and there are options to specify further. |
DNF team has discussed this issue and the current behavior seems to be intended: If "dnf info" and "dnf list" are not explicitly instructed with --available or --installed options, the commands prints an installed version and a newer available one. The primary use case for the commands is to tell what version is installed and if there is an update available. We will document this behavior. |
I am now on Fedora 41 using DNF5, and I wanted to get the available package version of a package in Fedora 40.
On F40 I would simply do
dnf info <package-spec> --releasever=XX
to check for package version available in Fedora XX.However, it seems some behaviour has changed or this is possibly a bug, I'm not sure.
When I do this now, DNF downloads metadata for the supplied
releasever
, but it lists the package information for the current release if<package-spec>
is installed:Conversely, a
<package-spec>
that is not installed outputs the correct information:Compared to the old DNF4 behaviour:
Even though the currently installed version is also not what I was looking for, at least it is showing the information that I actually wanted as well.
One can supply
--showduplicates
to (sort of) get the old behaviour back:However, I would still consider this a regression because (when not using
--showduplicates
) it is not actually showing the information requested, especially because the man page does not mention this change in behaviour, and the behaviour changes depending on whether<package-spec>
is installed or not.The text was updated successfully, but these errors were encountered: