I'm in a situation where the list of orphaned packages to be removed by apt-get autoremove
includes a package that I want to keep. Apparently I have accidentally removed a package which was depending on it. How can I now mark the package as explicitly desired, so that apt-get autoremove
will not remove it?
Use apt-mark
$ man apt-mark
...
manual
manual is used to mark a package as being manually installed, which will
prevent the package from being automatically removed if no other packages
depend on it.
So
sudo apt-mark manual <package-name>
Now autoremove
won't remove it.
To undo
sudo apt-mark auto <package-name>
Now autoremove
will remove the package if it is not a dependency of any other package.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments