The uninstall has this section in prerm:

# Automatically added by dh_installinit/12.10ubuntu1
if [ -x "/etc/init.d/mysql" ]; then
        invoke-rc.d mysql stop || exit 1
fi
# End automatically added section

This seems wrong, but if it is already stopped this still is fine and
has a return core ==0.

root@f:~# invoke-rc.d mysql stop
root@f:~# invoke-rc.d mysql stop
root@f:~# invoke-rc.d mysql stop
root@f:~# invoke-rc.d mysql stop
root@f:~# echo $?
0


Now I wonder in which state that is for you.
Even with the server disabled it should look like:

root@f:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: 
enabled)
...

The most likely reason (you had filed another bug with config files
removed) is that someone deleted /lib/systemd/system/mysql.service and
/etc/init.d/mysql.

$ rm /lib/systemd/system/mysql.service
$ rm /etc/init.d/mysql
$ systemctl daemon-reload
$ systemctl status mysql
$ systemctl status mysql
Unit mysql.service could not be found.

With that it would look like your report:
root@f:~# invoke-rc.d mysql stop
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.


But even then if you look above it would not run the code and uninstall.
All indicated some deep misconfiguration of your mysql service, I can't find 
any more in the logs to help unfortunately :-/
Given the other bug that you have reported I'd recommend restoring the config 
files of mysql to its default state (as shown in the other bug) - most likely 
things will work then.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1884163

Title:
  package mysql-server-8.0 8.0.20-0ubuntu0.20.04.1 failed to
  install/upgrade: installed mysql-server-8.0 package pre-removal script
  subprocess returned error exit status 1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1884163/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to