Force Removing Packages in Ubuntu

I couldn’t update tor in Ubuntu because it freaked out when I didn’t have a /var/run/tor directory. Even after creating the directory, it still freaked out. I ended up using the method in this post to fix the problem.

Here’s my resultant /var/lib/dpkg/info/tor.prerm:


#!/bin/sh
set -e
# Automatically added by dh_installinit
#if [ -x "/etc/init.d/tor" ]; then
#  if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
#    invoke-rc.d tor stop || exit $?
#  else
#    /etc/init.d/tor stop || exit $?
#  fi
#fi
# End automatically added section

Just comment it all out and do this:


sudo apt-get remove --force-yes tor

Voila!



Comments

  1. Ade

    March 30, 2007 at 6:18 PM

    Thanks so much for this – Ive been trying for two weeks to get tor removed – and thanks to this its now gone