Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1515115 - DNF autoremove would like to remove DNF itself
Summary: DNF autoremove would like to remove DNF itself
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 27
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-20 07:32 UTC by Giordano Battilana
Modified: 2017-11-23 18:44 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-22 12:21:59 UTC


Attachments (Terms of Use)

Description Giordano Battilana 2017-11-20 07:32:37 UTC
Description of problem:

I re-installed my Fedora when 25 came out because of this bug ( https://bugzilla.redhat.com/show_bug.cgi?id=1259865 ) that had broken my system. Afterwards I always performed the upgrade procedure.

After upgrading from 26 to 27 I ran a "sudo dnf autoremove" to see if there were packages to clean. However the command responds like this:

Sincronizzazione cache non riuscita per il repo 'region51-chrome-gnome-shell', disabilitazione in corso.
Sincronizzazione cache non riuscita per il repo 'docker-ce-stable', disabilitazione in corso.
Sincronizzazione cache non riuscita per il repo 'Dropbox', disabilitazione in corso.
Ultima verifica della scadenza dei metadati: 0:57:41 fa il dom 19 nov 2017 14:49:11 CET.
Errore: 
 Problema: The operation would result in removing the following protected packages: dnf


Version-Release number of selected component (if applicable):
2.7.5-1.fc27

How reproducible:
In my system it happens always

Steps to Reproduce:
1. Run sudo dnf autoremove

Actual results:
dnf throws error because it would remove dnf itself

Expected results:
dnf should output a possibly empty list of packages that are obsolete and can be removed

Additional info:
99% of the times I upgrade my software using Gnome Software. I tick the box when I'm about to shut down the system, then it reboots and it installs the upgrades.

Comment 1 Daniel Mach 2017-11-22 12:21:59 UTC
DNF was most likely installed as a dependency of another package.
If the original package that pulled DNF in was removed, dnf autoremove thinks that DNF can be removed as an unused dependency. Then it bumps into the protected packages check.

To fix the problem, please run:
$ dnf mark install dnf

Comment 2 Giordano Battilana 2017-11-23 18:42:42 UTC
Just for the record I was not getting this bug before upgrading to 27. Autoremove was not prompting for DND removal there.

Three fix you proposed works, I see however that other core packages are being suggested for removal, one example is grub.

Cheers

Comment 3 Giordano Battilana 2017-11-23 18:44:38 UTC
Autocorrect fails...
DND --> DNF
three --> the


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