On a freshly installed Fedora system, base packages such as
sudo are not counted as user installed, i.e.
dnf repoquery --userinstalled | grep sudo comes back empty. At the same time, these packages are also not considered by
dnf autoremove, i.e. the command does not try to remove them. So far, so good.
Now, if I mark
sudo as removable using
dnf mark remove sudo, a subsequent
dnf autoremove attempts (and fails) to remove it. The only way I know to again prevent autoremove to target
sudo is to mark it as explicity user installed using
dnf mark install sudo. However, now
sudo has a different state than it had in the beginning:
dnf repoquery --userinstalled | grep sudo now shows the
My question is: How do I reset the state of a base package such as
sudo? That is, how can I achieve that
dnf repoquery --userinstalled | grep sudo comes back empty while
dnf autoremove does not attempt to remove the package?