3 votes

Impossible d'installer MariaDB sur Ubuntu 20.04

J'ai essayé d'installer MariaDB sur mon système, mais l'installation s'arrête toujours à l'étape suivante

$ sudo apt install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  galera-3 libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libfcgi-perl libhtml-template-perl libreadline5
  libterm-readkey-perl mariadb-client-10.3 mariadb-client-core-10.3 mariadb-server-10.3 mariadb-server-core-10.3 socat
Suggested packages:
  libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test tinyca
The following NEW packages will be installed:
  galera-3 libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libfcgi-perl libhtml-template-perl libreadline5
  libterm-readkey-perl mariadb-client-10.3 mariadb-client-core-10.3 mariadb-server mariadb-server-10.3 mariadb-server-core-10.3 socat
0 upgraded, 17 newly installed, 0 to remove and 18 not upgraded.
Need to get 0 B/19.6 MB of archives.
After this operation, 165 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package galera-3.
(Reading database ... 213104 files and directories currently installed.)
Preparing to unpack .../00-galera-3_25.3.29-1_amd64.deb ...
Unpacking galera-3 (25.3.29-1) ...
Selecting previously unselected package libdbi-perl:amd64.
Preparing to unpack .../01-libdbi-perl_1.643-1_amd64.deb ...
Unpacking libdbi-perl:amd64 (1.643-1) ...
Selecting previously unselected package libconfig-inifiles-perl.
Preparing to unpack .../02-libconfig-inifiles-perl_3.000002-1_all.deb ...
Unpacking libconfig-inifiles-perl (3.000002-1) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../03-libaio1_0.3.112-5_amd64.deb ...
Unpacking libaio1:amd64 (0.3.112-5) ...
Selecting previously unselected package libreadline5:amd64.
Preparing to unpack .../04-libreadline5_5.2+dfsg-3build3_amd64.deb ...
Unpacking libreadline5:amd64 (5.2+dfsg-3build3) ...
Selecting previously unselected package mariadb-client-core-10.3.
Preparing to unpack .../05-mariadb-client-core-10.3_1%3a10.3.25-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-client-core-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Selecting previously unselected package mariadb-client-10.3.
Preparing to unpack .../06-mariadb-client-10.3_1%3a10.3.25-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-client-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Selecting previously unselected package mariadb-server-core-10.3.
Preparing to unpack .../07-mariadb-server-core-10.3_1%3a10.3.25-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-server-core-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Selecting previously unselected package socat.
Preparing to unpack .../08-socat_1.7.3.3-2_amd64.deb ...
Unpacking socat (1.7.3.3-2) ...
Selecting previously unselected package mariadb-server-10.3.
Preparing to unpack .../09-mariadb-server-10.3_1%3a10.3.25-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-server-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../10-libcgi-pm-perl_4.46-1_all.deb ...
Unpacking libcgi-pm-perl (4.46-1) ...
Selecting previously unselected package libfcgi-perl.
Preparing to unpack .../11-libfcgi-perl_0.79-1_amd64.deb ...
Unpacking libfcgi-perl (0.79-1) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../12-libcgi-fast-perl_1%3a2.15-1_all.deb ...
Unpacking libcgi-fast-perl (1:2.15-1) ...
Selecting previously unselected package libdbd-mysql-perl:amd64.
Preparing to unpack .../13-libdbd-mysql-perl_4.050-3_amd64.deb ...
Unpacking libdbd-mysql-perl:amd64 (4.050-3) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../14-libhtml-template-perl_2.97-1_all.deb ...
Unpacking libhtml-template-perl (2.97-1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../15-libterm-readkey-perl_2.38-1build1_amd64.deb ...
Unpacking libterm-readkey-perl (2.38-1build1) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../16-mariadb-server_1%3a10.3.25-0ubuntu0.20.04.1_all.deb ...
Unpacking mariadb-server (1:10.3.25-0ubuntu0.20.04.1) ...
Setting up libconfig-inifiles-perl (3.000002-1) ...
Setting up libreadline5:amd64 (5.2+dfsg-3build3) ...
Setting up libcgi-pm-perl (4.46-1) ...
Setting up libhtml-template-perl (2.97-1) ...
Setting up socat (1.7.3.3-2) ...
Setting up galera-3 (25.3.29-1) ...
Setting up libfcgi-perl (0.79-1) ...
Setting up libterm-readkey-perl (2.38-1build1) ...
Setting up libaio1:amd64 (0.3.112-5) ...
Setting up libdbi-perl:amd64 (1.643-1) ...
Setting up libcgi-fast-perl (1:2.15-1) ...
Setting up mariadb-server-core-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Setting up libdbd-mysql-perl:amd64 (4.050-3) ...
Setting up mariadb-client-core-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Setting up mariadb-client-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Setting up mariadb-server-10.3 (1:10.3.25-0ubuntu0.20.04.1) ...
Installing new version of config file /etc/apparmor.d/usr.sbin.mysqld ...
Installing new version of config file /etc/init.d/mysql ...
Installing new version of config file /etc/logrotate.d/mysql-server ...
Installing new version of config file /etc/mysql/debian-start ...
Created symlink /etc/systemd/system/mysql.service  /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service  /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service  /lib/systemd/system/mariadb.service.

La barre de progression indique 94% de réalisation et l'installation est bloquée ici depuis 2 heures et je ne pense pas qu'elle va reprendre. Quelqu'un peut-il me dire ce qui se passe et comment je peux installer MariaDB sur mon système ?

6voto

A.Azzouz Points 76

J'ai eu le même problème. Et voici les étapes que j'ai suivies pour le résoudre. Depuis un autre ssh/terminal.

Arrêtez l'apt et retirez la serrure

sudo killall apt
sudo killall apt-get

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*

sudo dpkg --configure -a

Purger les paquets mysql/mariadb

sudo apt-get purge mysql* mariadb* -y
sudo apt-get autoremove
sudo apt-get autoclean

Arrêtez AppArmor

sudo systemctl stop apparmor.service
sudo update-rc.d -f apparmor remove

# OR/AND
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld 

Vérifiez si tous les paquets sont OK

dpkg --configure -a

Redémarrer Important

systemctl reboot 

Installer mraiadb-server

sudo apt-get install mariadb-server

Activez AppArmor

sudo systemctl start apparmor.service
sudo update-rc.d apparmor defaults

# OR/AND
sudo rm /etc/apparmor.d/disable/usr.sbin.mysqld

C'est fait.

J'espère que cela fonctionnera pour vous aussi.

SistemesEz.com

SystemesEZ est une communauté de sysadmins où vous pouvez résoudre vos problèmes et vos doutes. Vous pouvez consulter les questions des autres sysadmins, poser vos propres questions ou résoudre celles des autres.

Powered by:

X