Skip to content
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

dnf5 update dnf has different behavior than dnf4 when the package is already updated #1862

Open
rcritten opened this issue Nov 14, 2024 · 1 comment
Labels
Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@rcritten
Copy link

rcritten commented Nov 14, 2024

dnf is treated specially when updating itself. Updating other packages seems to retain the old behavior "Nothing to do."

On Fedora 40:

# dnf update -y dnf
Last metadata expiration check: 0:04:44 ago on Thu 14 Nov 2024 11:58:48 AM EST.
Dependencies resolved.
Nothing to do.
Complete!
# echo $?
0

On Fedora 41:

dnf update -y dnf
Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Packages for argument 'dnf' available, but not installed.
# echo $?
1

There is actually not an update available for dnf and dnf is definitely installed (e.g. it is executing).

Is there a reason that dnf treats itself differently than other packages? It would be nice for scripting to have consistency.

rcritten added a commit to rcritten/freeipa that referenced this issue Nov 14, 2024
If there are no updates then dnf update dnf will fail with a return
code of 1.

rpm-software-management/dnf5#1862
abbra pushed a commit to abbra/freeipa that referenced this issue Nov 15, 2024
If there are no updates then dnf update dnf will fail with a return
code of 1.

rpm-software-management/dnf5#1862
@jrohel
Copy link
Contributor

jrohel commented Nov 21, 2024

The output of the command says: Packages for argument 'dnf' available, but not installed.

There is actually not an update available for dnf and dnf is definitely installed (e.g. it is executing).

No, dnf is not really installed. The dnf5 package is installed on the system, and for compatibility reasons there is a dnf link that points to dnf5.

# ls -l $(which dnf) 
lrwxrwxrwx. 1 root root root 4 12 Nov 01.00 /usr/bin/dnf -> dnf5

Thus: dnf5 upgrade -y dnf5
Using a compatible dnf link and a compatible update alias, we can write: dnf update -y dnf5

@github-project-automation github-project-automation bot moved this to Backlog in DNF team Nov 21, 2024
@jan-kolarik jan-kolarik added Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Status: Backlog
Development

No branches or pull requests

3 participants