Bug 2221907

Summary: dnf5 is not marked as protected, removal leaves system more or less bricked
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: dnf5Assignee: Evan Goode <egoode>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: jkolarik, lsm5, nsella, pkratoch, rpm-software-management
Target Milestone: ---Keywords: Triaged
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: 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 Miro Hrončok 2023-07-11 08:47:47 UTC
It's quite easy to remove dnf5 with dnf5. A Fedora 39+ system then has no package manager. Please ensure dnf5 is marked as protected.

Reproducible: Always

Steps to Reproduce:
1.# dnf remove dnf5
Actual Results:  
Transaction Summary:
 Removing:         32 packages
...
[ 3/33] Erasing dnf5-0:5.0.15-3.fc39.x86_64
...

Expected Results:  
Failed to resolve the transaction:
Problem: The operation would result in removing the following protected packages: dnf5


# dnf
bash: dnf: command not found
# yum
bash: yum: command not found

Comment 1 Jan Kolarik 2023-07-13 12:25:49 UTC
I guess we need to add the "dnf5" package here: https://github.com/rpm-software-management/dnf5/blob/5.0.15/libdnf5/conf/config_main.cpp#L296. The "dnf" is not working now as it is only an alias.

Comment 2 Lokesh Mandvekar 2023-08-08 18:38:25 UTC
just a +1 here. I noticed the dnf removal issue for the first time today. I've been running rawhide for over a month IIRC.

I usually run: sudo dnf5 -y update --allowerasing --best, and it has worked without issues until today.


I was able to get things back on track with `rpm -i $DOWNLOADED_DNF_RPM_FILE`

Comment 3 Fedora Release Engineering 2023-08-16 08:12:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.