This is the function in package.el that normally saves the value to the customization system. By redefining it to a dummy function, nothing will be saved. My custom.el stays clean.

Telling package.el about manually installed packages

That was easy. But now “package-list-packages” (and also “paradox-list-packages”) list all packages as “dependency”, none as “installed”. Without the saved values from “packages-selected-packages” package.el doesn’t know that what packages I have installed manually and which it installed automatically.

So we must transfer the information from use-packages’s “:ensure t” to package.el !

To do this, simply redirect use-packages’ handler for the “:ensure” clause to your own function. Save those packages that have an ensure clause into “packages-selected-packages” and finally call the original function: