On a Plesk server, MySQL somehow went missing. When I tried to remove a package, I get error
root@82-165-118-245:~# dpkg --remove plesk-config-troubleshooter
(Reading database ... 168528 files and directories currently installed.)
Removing plesk-config-troubleshooter (18.0-v.ubuntu.18.04+p18.0.39.2+t211117.1817) ...
dpkg action:
ERROR while trying to detect MySQL service name
Check the error reason (see log file: /var/log/plesk/install/plesk_18.0.39_installation.log), fix and try again
dpkg action:
ERROR while trying to detect MySQL service name
Package script failed
***** installing problem report *****
ERROR while trying to detect MySQL service name
Package script failed
dpkg: error processing package plesk-config-troubleshooter (--remove):
installed plesk-config-troubleshooter package pre-removal script subprocess returned error exit status 1
Errors were encountered while processing:
plesk-config-troubleshooter
root@82-165-118-245:~#
To fix this, I removed the prerm and postrm scripts. These scripts execute before and after a package is removed. It is not recommended to remove it, but if these scripts prevent you from uninstalling a package, you can remove them as the last option.
mv /var/lib/dpkg/info/plesk-config-troubleshooter.prerm ~/
mv /var/lib/dpkg/info/plesk-config-troubleshooter.postrm ~/
Or you can just edit the file, put
exit 0
somewhere before the error happens.
Leave a Reply