mariadb-server failed to install: invoke-rc.d: initscript mysql, action "stop" failed
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| mariadb (Ubuntu) |
Fix Released
|
Medium
|
Otto Kekäläinen | ||
Bug Description
I was installing phpmyadmin and maria db to later configure them with nginx
ProblemType: Package
DistroRelease: Ubuntu 23.04
Package: mariadb-server (not installed)
ProcVersionSign
Uname: Linux 6.2.0-20-generic x86_64
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckR
Date: Tue Sep 5 11:26:42 2023
ErrorMessage: new mariadb-server package pre-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2023-09-04 (0 days ago)
InstallationMedia: Ubuntu 23.04 "Lunar Lobster" - Release amd64 (20230418)
Python3Details: /usr/bin/
PythonDetails: N/A
RelatedPackageV
dpkg 1.21.21ubuntu1
apt 2.6.0ubuntu0.1
SourcePackage: mariadb
Title: package mariadb-server (not installed) failed to install/upgrade: new mariadb-server package pre-installation script subprocess returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)
| summary: |
- package mariadb-server (not installed) failed to install/upgrade: new - mariadb-server package pre-installation script subprocess returned error - exit status 1 + mariadb-server failed to install: invoke-rc.d: initscript mysql, action + "stop" failed |

Relevant log:
Preparing to unpack .../0-mariadb- server_ 1%3a10. 11.2-1_ amd64.deb ... dpkg-install- rlmkoy/ 0-mariadb- server_ 1%3a10. 11.2-1_ amd64.deb (--unpack):
[0;1;31mFailed to stop mariadb.service: Unit mariadb.service not loaded.[0m
invoke-rc.d: initscript mariadb, action "stop" failed.
[0;1;31mFailed to stop mysql.service: Unit mysql.service not loaded.[0m
invoke-rc.d: initscript mysql, action "stop" failed.
Attempt to stop MariaDB/MySQL server returned exitcode 5
There is a MariaDB/MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
[1mdpkg:[0m error processing archive /tmp/apt-
new mariadb-server package pre-installation script subprocess returned error exit status 1
Not sure about the root cause but https:/ /salsa. debian. org/mariadb- team/mariadb- server/ -/merge_ requests/ 26 might make it easier to debug and the fix might even be one of the commits in https:/ /salsa. debian. org/mariadb- team/mariadb- server/ -/merge_ requests/ 48