DNF might remove essential system packages if you used PackageKit (GNOME Software, KDE Apper) in the past
link to this item - Bugzilla: #1259865
There was an unfortunate situation in the past few Fedora releases where PackageKit and DNF didn't work well together. If you installed something via PackageKit (used by GNOME Software or KDE Apper), it didn't mark such packages as "user installed" in the DNF database (which is used to differentiate user-requested packages from other packages installed purely as a dependency, but not explicitly requested by the user). Similarly, if you updated your system using PackageKit (GNOME offline updates, Apper), it erased such "user installed" flags from all updated packages. DNF then tries to remove any unnecessary packages during its next transaction (or when specifically asked using sudo dnf autoremove). This might lead to removing core system packages because DNF no longer sees them as "user installed" and considers them a no-longer-needed dependency. It is also possible that this might happen to you when performing a system upgrade to Fedora 24.
This is now fixed in Fedora 24 (since libhif-0.2.2-3.fc24) and Fedora 23 (since libhif-0.2.2-3.fc23). Future use of PackageKit (GNOME Software, Apper) should be safe. However, if you have ever used these tools in the past, you're strongly advised to fix your "user installed" database before you start using DNF:
First, make sure your libhif package version is the same as described above or newer:
rpm -q libhif
If not, update it, and check again:
sudo dnf --refresh update libhif
Reboot after update.
Then, mark all your current packages as "user installed" using this command:
rpm -qa --qf '%{NAME}\n' | xargs sudo dnf mark install
Please note that this solution is slightly excessive, because you're going to end up with all your packages considered either system essential or user requested, and none of them is ever going to be removed as a no-longer-needed dependency. However, this is the only way how to be absolutely sure that you're not going to be affected by this issue, at a relatively small cost (some packages might stay on your disk unnecessarily). Power users can tweak this solution according to their needs.