I ran sudo apt-get install tor which installed these packages:

The following NEW packages will be installed:
  tor tor-geoipdb torsocks

But when I tried to remove it with sudo apt-get remove tor - providing the same package name (only tor), it is missing torsocks:

The following packages will be REMOVED:
  tor tor-geoipdb

So torsocks stays installed - I really hate this behavior. Why is it happening and how can I fix it? How can I be sure everything what was installed gets removed?

  • What is the output of apt-cache rdepends torsocks?
    – dr_
    Aug 25 '15 at 9:35

To uninstall a package with all its dependencies you can use --auto-remove

sudo apt-get remove --auto-remove tor

  • I guess it's not possible to uninstall exactly the packages that were installed by the previous apt-get install * command. Because this will uninstall all dependencies that aren't needed, but maybe I want to keep some of them. Nevermind, thanks for the answer.
    – MichalH
    Aug 25 '15 at 10:29
  • See my answer, you can (and should) mark the ones you want to keep as manually installed.
    – BubuIIC
    Aug 25 '15 at 10:32

You can do a sudo apt-get autoremove to uninstall everything that was automatically installed and is no longer needed.

I guess tor-geoipdb gets removed because it depends in tor so it can't be installed without tor being installed.

Now torsocks can be installed on it's own but is no longer required to being installed. So it can be automatically removed.

You can query the state of a package (auto or manual) can be changed with apt-mark.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.