Bug 2221907 - dnf5 is not marked as protected, removal leaves system more or less bricked
Summary: dnf5 is not marked as protected, removal leaves system more or less bricked
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Evan Goode
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-11 08:47 UTC by Miro Hrončok
Modified: 2023-10-22 08:24 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-10-22 08:24:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.

Comment 4 Evan Goode 2023-09-21 18:35:26 UTC
https://github.com/rpm-software-management/dnf5/pull/906 has been merged, which protects DNF 5 from uninstalling itself (without overriding the protected_packages option), but still lets DNF 4 uninstall DNF 5.

Comment 5 Fedora Update System 2023-10-18 15:10:47 UTC
FEDORA-2023-a066057708 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a066057708

Comment 6 Fedora Update System 2023-10-19 02:17:13 UTC
FEDORA-2023-a066057708 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a066057708`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a066057708

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2023-10-20 02:12:26 UTC
FEDORA-2023-a066057708 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a066057708`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a066057708

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2023-10-22 08:24:52 UTC
FEDORA-2023-a066057708 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.