Sample Header Ad - 728x90

Remove recommended dependencies of installed package without uninstalling the package nor its actual dependencies with apt

2 votes
1 answer
2066 views
I want to remove the recommended packages of a package using apt. my-package is installed, and I want to keep it and its dependencies.
apt-cache depends  | grep Recommends
returns a variety of packages, none of which I want. How can I remove these packages? I can write a bash script to do it but I'm hoping there's an apt way to do it. I have searched online and haven't found a way to uninstall these recommended packages *without uninstalling the package itself and its required dependencies*. In other words, I want to keep my-package and its dependencies, but remove the packages it recommends. Furthermore I ideally don't want to edit config files; I want to keep the system settings untouched.
Asked by user481099
Jul 11, 2021, 04:55 AM
Last activity: Jul 1, 2025, 02:02 AM