How do I prevent dnf autoremove from removing specific packages?
I have listed a package with the installonlypkgs option in /etc/dnf/dnf.conf. I have also listed that package with the exclude option because I do not want that package to be auto-upgraded. In particular, I have: -
exclude=xorg-x11-drv-intel
installonlypkgs=xorg-x11-drv-intel
Running dnf upgrade does not offer to upgrade the package, which is as expected and as desired. However, running dnf autoremove lists the package for removal and asks for confirmation. The man page for dnf.conf, installonlypkgs option says, "These packages are never removed by dnf autoremove even if they were installed as dependencies." The man page for dnf, autoremove command corroborates this: "Packages listed in installonlypkgs are never automatically removed by this command." So, how do I prevent dnf autoremove from removing specific packages, if not through installonlypkgs?