Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I was playing around with a ubuntu 11 VPS, and I installed tomcat using apt-get, and after some time I messed something up, and instead of figuring out the issue I thought I could just remove the package and start over.

sudo apt-get remove tomcat6

I noticed when I removed the package, the folders that tomcat used were still around, so I deleted them:


When I tried to install the package again, there were some errors as it was trying to look for files in I believe /usr/share/tomcat6 (I don't recall now).

Did I miss a step or something, shouldn't have this theoretically worked?

share|improve this question

For what is worth, here is your answer:

sudo apt-get purge [package]
sudo apt-get install <package> --reinstall
share|improve this answer

You can remove tomcat using terminal in Ubuntu with these very simple steps:

Step 1: Find all packages related with tomcat

dpkg -l|grep tomcat 

Step 2: Remove desired tomcat package

sudo dpkg -P (package you want to delete)
share|improve this answer
Welcome to Ask Ubuntu! We require that you explicitly disclose that you're linking to your own blog (or other page you've written or are otherwise affiliated with), when doing so. At minimum, please edit your post to include such disclosure. Also, I recommend against using shortened links (like the "" link here), as they prevent readers from knowing what site they link to (and thus discourage many readers, for security reasons). – Eliah Kagan Jan 7 '13 at 10:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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