A
A
Aleksandr Yurchenko2019-10-25 13:45:06
ubuntu
Aleksandr Yurchenko, 2019-10-25 13:45:06

Error installing Mariadb 10.4. How to fix?

Hello.
I can not install mariadb, I do everything according to the instructions .

spoiler
I’ll make a reservation right away, the system is clean (Ubuntu 18.04.3), I installed it today. After installed only php 7.3.

After completing these steps
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.realcompute.io/mariadb/repo/10.4/ubuntu bionic main'

sudo apt update
sudo apt install mariadb-server

Installation starts but fails with an error
Setting up mariadb-common (1:10.4.8+maria~bionic) ...
(Reading database ... 202092 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.4_1%3a10.4.8+maria~bionic_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
'systemctl stop mysql' returned 5
There is a 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-10.4_1%3a10.4.8+maria~bionic_amd64.deb (--unpack):
 new mariadb-server-10.4 package pre-installation script subprocess returned error exit status 1
Selecting previously unselected package libmysqlclient20:amd64.
Preparing to unpack .../libmysqlclient20_5.7.27-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libmysqlclient20:amd64 (5.7.27-0ubuntu0.18.04.1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.046-1_amd64.deb ...
Unpacking libdbd-mysql-perl (4.046-1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../libterm-readkey-perl_2.37-1build1_amd64.deb ...
Unpacking libterm-readkey-perl (2.37-1build1) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../mariadb-server_1%3a10.4.8+maria~bionic_all.deb ...
Unpacking mariadb-server (1:10.4.8+maria~bionic) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mariadb-server-10.4_1%3a10.4.8+maria~bionic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

When trying to restart the installation (sudo apt install mariadb-server), the following warning appears:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mariadb-server is already the newest version (1:10.4.8+maria~bionic).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.4 (>= 1:10.4.8+maria~bionic) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

When I run sudo apt --fix-broken install I get the following:
spoiler

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  mariadb-server-10.4
Suggested packages:
  mailx mariadb-test tinyca
The following NEW packages will be installed:
  mariadb-server-10.4
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/4 657 kB of archives.
After this operation, 77,9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 202590 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.4_1%3a10.4.8+maria~bionic_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
'systemctl stop mysql' returned 5
There is a 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-10.4_1%3a10.4.8+maria~bionic_amd64.deb (--unpack):
 new mariadb-server-10.4 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mariadb-server-10.4_1%3a10.4.8+maria~bionic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


Tried deleting the repository and trying again - to no avail. I just can't figure out what it could be? Ubuntu installed in the minimum assembly) without additional. by ..
Even though the message says:
Failed to stop mysql.service: Unit mysql.service not loaded.
'systemctl stop mysql' returned 5

But mysql is not installed! When checked by the team: sudo systemctl status myslqI get Unit myslq.service could not be found.
Some kind of damn mysticism. Does anyone have any ideas how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iddqda, 2019-10-25
@iddqda

perhaps the package maintainers did not take into account that someone would install a custom version from scratch.
first try to put the version that comes in the distribution
and then put your 10.4 on top ,
well, that is.

sudo add-apt-repository -r 'deb [arch=amd64,arm64,ppc64el] http://mirror.realcompute.io/mariadb/repo/10.4/ubuntu bionic main'
apt update
apt install mariadb-server

then the same without the -r switch in the first command

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question