Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MariaDB Server is not installing on Debian 12

1,277 views
Skip to first unread message

Timothy M Butterworth

unread,
Mar 19, 2023, 11:00:06 PM3/19/23
to
I am unable to install MariaDB on debian 12. apt show says the mariadb-server is Version: 1:10.11.2-1.

apt upgrade
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
default-mysql-server : Depends: mariadb-server but it is not installed
mariadb-plugin-provider-bzip2 : Depends: mariadb-server (>= 1:10.11.1-1) but it is not installed
mariadb-plugin-provider-lz4 : Depends: mariadb-server (>= 1:10.11.1-1) but it is not installed
mariadb-plugin-provider-lzma : Depends: mariadb-server (>= 1:10.11.1-1) but it is not installed
mariadb-plugin-provider-lzo : Depends: mariadb-server (>= 1:10.11.1-1) but it is not installed
mariadb-plugin-provider-snappy : Depends: mariadb-server (>= 1:10.11.1-1) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

apt install mariadb-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
 mailx mariadb-test netcat-openbsd
The following NEW packages will be installed:
 mariadb-server
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
120 not fully installed or removed.
Need to get 0 B/3,581 kB of archives.
After this operation, 54.5 MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 327299 files and directories currently installed.)
Preparing to unpack .../mariadb-server_1%3a10.11.2-1_amd64.deb ...
Failed to stop mariadb.service: Unit mariadb.service not loaded.
invoke-rc.d: initscript mariadb, action "stop" failed.
Failed to stop mysql.service: Unit mysql.service not loaded.
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!
dpkg: error processing archive /var/cache/apt/archives/mariadb-server_1%3a10.11.2-1_amd64.deb (--unpack):
new mariadb-server package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server_1%3a10.11.2-1_amd64.deb


--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄⠀⠀

Dan Ritter

unread,
Mar 20, 2023, 6:50:06 AM3/20/23
to
Timothy M Butterworth wrote:
> I am unable to install MariaDB on debian 12. apt show says the
> mariadb-server is Version: 1:10.11.2-1.
>
> Failed to stop mariadb.service: Unit mariadb.service not loaded.
> invoke-rc.d: initscript mariadb, action "stop" failed.
> Failed to stop mysql.service: Unit mysql.service not loaded.
> 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!

Have you done that?

> new mariadb-server package pre-installation script subprocess returned
> error exit status 1

If there is no mariadb or mysql server running, but the system
believes that there is, /var/lib/dpkg/info should contain a
mariadb.preinst script which can be examined for what mechanism
it is using to determine that.

-dsr-

Timothy M Butterworth

unread,
Mar 20, 2023, 11:00:07 AM3/20/23
to
On Mon, Mar 20, 2023 at 7:49 AM Dan Ritter <d...@randomstring.org> wrote:
Timothy M Butterworth wrote:
> On Mon, Mar 20, 2023 at 6:25 AM Dan Ritter <d...@randomstring.org> wrote:
>
> > Timothy M Butterworth wrote:
> > > I am unable to install MariaDB on debian 12. apt show says the
> > > mariadb-server is Version: 1:10.11.2-1.
> > >
> > > Failed to stop mariadb.service: Unit mariadb.service not loaded.
> > > invoke-rc.d: initscript mariadb, action "stop" failed.
> > > Failed to stop mysql.service: Unit mysql.service not loaded.
> > > 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!
> >
> > Have you done that?
> >
>
> I do not have any instances of MySQL or MariaDB running. The unit files are
> not even installed.

The pre-inst script believes that you do.


> > > new mariadb-server package pre-installation script subprocess returned
> > > error exit status 1
> >
> > If there is no mariadb or mysql server running, but the system
> > believes that there is, /var/lib/dpkg/info should contain a
> > mariadb.preinst script which can be examined for what mechanism
> > it is using to determine that.


^ That. Go read it, execute it by hand, see what it is mistaken
about.

-dsr-

Dan,

Thanks for the info. I got it to install. I copied the mariadb.service file and made a soft link from it to mysql.service. I was able to successfully run `systemctl stop` against both service files. There was nothing to stop since there was no database installed but I tricked the script into thinking that it stopped the database. Anyway it was a little hacky but I got mariadb-server installed.

Tim

Cosmin Humeniuc

unread,
Apr 21, 2023, 2:40:06 PM4/21/23
to
I have the same problem of not being able to install mariadb-server
1:10.11.2-1. The error is the same - a failed attempt to stop
mariadb.service or mysql.service.

In my case, there is no service running for either of them, so I have
nothing to stop. I also checked, and there's no mariadb.preinst file in
/var/lib/dpkg/info.

However, I started from these lines in the output:
> Errors were encountered while processing:
> /var/cache/apt/archives/mariadb-server_1%3a10.11.2-1_amd64.deb

and I used dpkg-deb to look in that package file. DEBIAN/preinst had a
`stop_server()` function that was trying to stop existing servers based
on the result of:
> pgrep -x --nslist pid --ns $$ "mysqld|mariadbd"

(at line 31). I executed that in a shell and I did get a result - only
it wasn't for a running server, but for a standalone process:
> pgrep -x --nslist pid --ns $$ "mysqld|mariadbd"
> 1939

> ps aux | grep 1939
> cosmin 1939 0.0 1.2 2439604 204892 ? Sl 19:22 0:02
/usr/sbin/mysqld
--defaults-file=/home/cosmin/.local/share/akonadi/mysql.conf
--datadir=/home/cosmin/.local/share/akonadi/db_data/
--socket=/run/user/1000/akonadi/mysql.socket
--pid-file=/run/user/1000/akonadi/mysql.pid

My guess is that the check from `preinst` could be improved to handle
cases like this. Does it count like a bug? Should I file a report?

--
Cosmin

The Wanderer

unread,
Apr 21, 2023, 3:23:14 PM4/21/23
to
How is that not a server? /usr/sbin/mysqld is the server binary; that
looks like an instance of the server, run by (what I'm presuming is) an
ordinary user rather than by e.g. the 'mysql' account that is used to
run the 'system-wide' instance(s?) of that server.

I could just be blind or ignorant, but I can't see any reason offhand
why that process wouldn't be expected to need to be stopped in just the
same way as those running under other user IDs.

--
The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw

signature.asc
0 new messages