I tried to remove KDE from my system.
When I run dpkg -r kdebase-bin
, it says kdebase-data
depends on it. So how can I remove all the packages related to KDE?
4 Answers
Usually one uses a higher-level utility instead of dpkg. You can use apt-get to remove a package and all its dependencies.
apt-get remove <package>
Unlike apt-get
, aptitude
can recursively remove packages which were installed as dependencies, but which are no longer depended on when the requested removal happens. You have to have installed those packages with aptitude
in order for this to work, though.
There are also tools like deborphan
which can identify packages which may no longer be necessary on your system, even if you didn't use aptitude
to install them. However, you have to supply it with a list of packages you do want on your system, but it's usually a quick job (there will be fewer packages it has to ask about than you might imagine).
-
great point. Anyway, I set the answer to Kurt's, that resolved my problem. Thanks.– RockyOct 15, 2011 at 10:49
-
To remove package and its dependencies, use purge
Check all dependencies with following command
# sudo dpkg --list | grep <package-name>
Remove packages and its dependencies
# sudo apt purge <package>
-
Purging packages will remove more than the package and its dependencies... Purging may result in complete loss of the package... Never purge a package if you want to use it again in the future!– Error404Dec 21, 2021 at 10:52
-
The question mentions to remove
package + all dependent packages
so I thinkpurge
is the appropriate command for this purpose. Dec 21, 2021 at 11:21 -
-
1
apt-get remove kdebase-bin
it will resolve the dependencies.