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?
- 1,416
- 2
- 16
- 20
-
1I found this does the work: `apt-get remove kdebase-bin` it will resolve the dependencies. – Oct 14 '11 at 16:12
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>
- 246
- 2
- 5
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).
- 1,416
- 2
- 16
- 20
-
great point. Anyway, I set the answer to Kurt's, that resolved my problem. Thanks. – Oct 15 '11 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>
- 173
- 7
-
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! – Error404 Dec 21 '21 at 10:52
-
The question mentions to remove `package + all dependent packages` so I think `purge` is the appropriate command for this purpose. – Muhammad Tariq Dec 21 '21 at 11:21
-
-
1