$ cat /etc/dnf/dnf.conf [main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=True exclude=kernel Excerpt from man dnf.conf: installonlypkgs list List of provide names of packages that should only ever be installed, never upgraded. Kernels in particular fall into this category. These packages are never removed by dnf autoremove even if they were installed as dependencies (see clean_requirements_on_remove for auto removal details). The num‐ ber of kept package versions is regulated by installonly_limit. installonly_limit integer Number of installonly packages allowed to be installed concur‐ rently. Defaults to 3. -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx http://lists.fedoraproject.org/admin/lists/devel@xxxxxxxxxxxxxxxxxxxxxxx