8

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
  • 1
    I found this does the work: apt-get remove kdebase-bin it will resolve the dependencies.
    – Rocky
    Oct 14 '11 at 16:12
10

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>
8
dpkg -r --force-depends  $pkg
apt-get install -f
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).

2
  • great point. Anyway, I set the answer to Kurt's, that resolved my problem. Thanks.
    – Rocky
    Oct 15 '11 at 10:49
  • But there's also apt-get autoremove.
    – musiphil
    Aug 28 '13 at 21:41

Your Answer

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