Bug 1371639

Summary: "dnf autoremove" tries remove dnf
Product: [Fedora] Fedora Reporter: Tomasz Kłoczko <kloczko.tomasz>
Component: dnfAssignee: rpm-software-management
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ignatenko, jsilhan, kloczko.tomasz, mluscon, packaging-team-maint, pnemade, rpm-software-management, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-31 10:12:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
debugdata none

Description Tomasz Kłoczko 2016-08-30 17:14:27 UTC
Description of problem:

Few days ago I've removed yum package as I don't need it any more and now I see "dnf autoremove" is a bit useless :)
I think that dnf themselves should be blacklisted by definition from list of packages which can possibly be removed.

# dnf autoremove
Last metadata expiration check: 0:38:04 ago on Tue Aug 30 17:31:04 2016.
Dependencies resolved.
Error: The operation would result in removing the following protected packages: dnf.

Comment 1 Igor Gnatenko 2016-08-31 05:47:59 UTC
bascially it tries to remove some dependency of DNF.

run dnf with --debugsolver and attach created directory "debugdata".

Comment 2 Tomasz Kłoczko 2016-08-31 10:02:32 UTC
Created attachment 1196283 [details]
debugdata

debug data directory is in attachment

Comment 3 Igor Gnatenko 2016-08-31 10:12:11 UTC
try something like:
# dnf mark install dnf NetworkManager-wifi kernel-devel
and all other packages which you want explicitly to keep.

I think you were using yum-deprecated or/and PackageKit (until some release). Those 2 do not write to DNF database, so DNF thinks that it's not user-installed packages.

Comment 4 Tomasz Kłoczko 2016-08-31 11:19:38 UTC
Just in case .. I've been generating debugdata on fully updated few minuter earlier system to latest rawhide.

# dnf mark install dnf
dnf-1.1.10-1.fc26.noarch marked as user installed.

and after this "dnf autoremove" is producing now list of possibly to remove list of packages.
Nevertheless if it is possible to mark package X to not be listed in atoremove  list IMO dnf should be on such list OOTB.