Ask Your Question

How do I prevent dnf autoremove from removing specific packages?

asked 2015-05-30 16:04:47 -0500

sensaurav gravatar image

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: -


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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-10 09:29:52 -0500

rjmco gravatar image

Have you tried

dnf mark install xorg-x11-drv-intel

This will mark the packages as having been installed by the user and prevent it from being removed by autoremove.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-05-30 16:04:47 -0500

Seen: 1,609 times

Last updated: May 30 '15