1

I'm looking for the equivalent of running apt install with a package that came pre-installed on the system or was automatically installed as a dependency of another package. apt then simply marks that package as manually installed, which means it won't be automatically uninstalled along with the package that depends on it or during autoremove.

So far, I was unable to find any answer to this online. Running dnf install with an auto-downloaded dependency simply prints "Nothing to do." but doesn't change the status of the package to manually installed. The dnf man page didn't mention any special flags under the install command either.

The only "solution" so far was to uninstall the package (along with all packages that depend on it), manually reinstall it and then reinstall the dependent packages. That's not practical. Compared to that, even manually editing some file databases would be easier.

1 Answer 1

3

dnf mark install <package> marks the package as manually installed in Fedora (and similarly dnf mark remove <package> does the opposite -- remove the mark if you no longer wish to manually keep the package).

From dnf man page:

Marks the specified packages as installed by user. This can be useful if any package was installed as a dependency and is desired to stay on the system when Autoremove Command or Remove Command ... is executed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.