title: Removing broken packages in Ubuntu
body: <p>There was an error when I tried to remove a package, so it was left in a broken state. I tried the following:</p>
  
  <pre><code>sudo dpkg --remove --force-remove-reinstreq rvm
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>(Reading database ... 41743 files and directories currently installed.)
  Removing rvm (1.29.3-1) ...
  bash: rvm: command not found
  dpkg: error processing package rvm (--purge):
   subprocess installed pre-removal script returned error exit status 127
  Errors were encountered while processing:
   rvm
  </code></pre>
  
  <p>.</p>
  
  <pre><code>sudo dpkg --purge rvm
  </code></pre>
  
  <p>Output: same as above</p>
  
  <pre><code>sudo dpkg -i --force-overwrite package
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>dpkg: error processing archive rvm (--install):
   cannot access archive: No such file or directory
  Errors were encountered while processing:
   rvm
  </code></pre>
  
  <p>Is there a way to force remove it, ignoring all errors? I'm using Ubuntu 16.04 on WSL.</p>