0

I was trying to uninstall mysql using sudo apt-get --purge remove mysql-server but getting following error

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

So I prompted to kill all running mysql processes.For this I did ps -ef | grep mysql and get

root      4473     1  0 17:46 ?        00:00:00 /bin/bash /usr/share/mysql/mysql-systemd-start post
root      4636  3783  0 17:46 pts/6    00:00:00 grep --color=auto mysql
root@viji-Latitude-E5440:~# sudo kill -9 4473
root@viji-Latitude-E5440:~# ps -ef | grep mysql
root      4672     1  0 17:47 ?        00:00:00 /bin/bash /usr/share/mysql/mysql-systemd-start post
root      4745  3783  0 17:47 pts/6    00:00:00 grep --color=auto mysql

I am trying to kill this mysql process but not able to do.
What should I do now?

js_248
  • 147
  • 1
  • 6

1 Answers1

2

You are entirely able to kill the process, but it seems to be starting itself again. If you notice, the PID is changing each time that you kill it. Something on your system is automatically starting it on your behalf. You have a couple of options:

  • Seek and destroy whatever is starting it (usually some sort of web control panel like XAMPP, probably in this case your service manager)
  • Boot into a shell and kill it from there (using recovery mode)

I prefer the latter, since I don't know how you installed mysql to begin with, but if you did use something similar to XAMPP, it's worth opening the control panel and trying to stop MySQL from within (even if that means re-installing the control panel software).

If you want to go with the former, you can try sudo service mysql-server stop and see if after this you can uninstall it.

XtrmJosh
  • 363
  • 1
  • 4
  • 15