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

I just uninstalled tomcat6 and installed tomcat7, and now that I want to start, stop or restart the service, ubuntu shows the two of them, for example

sudo service tomcat

And then ubuntu shows two alternatives, for both tomcat6 and tomcat7, but I don't have and I don't want tomcat6 to appear there, What should I do?

share|improve this question
up vote 2 down vote accepted

just clean the tomcat6 referred lines in /etc/init.d/tomcat could solve your question.

after clean the file may like that:


case $1 in

 echo “starting tomcat7 from $TOMCATPATH”
 sh $TOMCATPATH/bin/

 echo “stopping tomcat7 from $TOMCATPATH”
 sh $TOMCATPATH/bin/

 $0 stop
 $0 start

 echo $”usage: $0 {start|stop|restart}”

exsit 0

suggestion to uninstall a software:

sudo apt-get purge xxxx-software

purge will also removes config files.

share|improve this answer
It doesn't work. – eLRuLL May 9 '13 at 16:20
@eLRuLL how did you uninstall tomcat6 and what's the content of /etc/init.d/tomcat – Teifi May 10 '13 at 1:40
uninstall with apt-get remove tomcat6, and I have tomcat6 and tomcat7 on /etc/init.d/, about the content, they are both similar. – eLRuLL May 10 '13 at 2:43
@eLRuLL updated answer, hope it could help u. – Teifi May 10 '13 at 4:07
but there is no /etc/init.d/tomcat file there are both tomcat6 and tomcat7 files. – eLRuLL May 10 '13 at 4:12

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.