# Erreur lors de l'installation du paquet mysql-server

**URL:** <https://www.debian-fr.org/t/erreur-lors-de-linstallation-du-paquet-mysql-server/73471>\
**Category:** Support Debian\
**Tags:** mysql\
**Created:** [Mai 16, 2017, 10:40 UTC](https://www.debian-fr.org/t/erreur-lors-de-linstallation-du-paquet-mysql-server/73471 "2017-05-16T10:40:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLIDE](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/b/919ad9/32.png) [@BLIDE](https://www.debian-fr.org/u/BLIDE)\
**Post date:** [Mai 16, 2017, 10:40 UTC](https://www.debian-fr.org/t/erreur-lors-de-linstallation-du-paquet-mysql-server/73471/1 "2017-05-16T10:40:53Z")

</div>

Alors que je m’appète à faire un serveur mail, en suivant ce tutoriel [https://www.tictech.info/post/mail\_preparation#toc0](https://www.tictech.info/post/mail_preparation#toc0) . Lors des premières étapes j’ai directement une erreur que j’essaye de résoudre, cela fait quelques jours…

L’erreur est :  
apt install mysql-server

```
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

```

Serait-ce une non-comptabilité du paquet, le tuto est en debian 7 alors que je suis en 8?  
PS: J’ai/avais une base de donnée en MariaDB

En fassent apt-get -f install comme demandé dans le message d’erreur, une autre erreur intervient…

> ```
> apt-get -f install
> 
> ```

> ```
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Correcting dependencies... Done
> The following extra packages will be installed:
> mysql-server-5.5
> Suggested packages:
> mailx tinyca
> The following NEW packages will be installed:
> mysql-server-5.5
> 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> 9 not fully installed or removed.
> Need to get 0 B/1,774 kB of archives.
> After this operation, 32.4 MB of additional disk space will be used.
> Do you want to continue? [Y/n] y
> Preconfiguring packages ...
> (Reading database ... 34639 files and directories currently installed.)
> Preparing to unpack .../mysql-server-5.5_5.5.55-0+deb8u1_amd64.deb ...
> Failed to stop mysql.service: Unit mysql.service not loaded.
> invoke-rc.d: initscript mysql, action "stop" failed.
> invoke-rc.d 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/mysql-server-5.5_5.5.55-0+deb8u1_amd64.deb (--unpack):
> subprocess new pre-installation script returned error exit status 1
> Errors were encountered while processing:
> /var/cache/apt/archives/mysql-server-5.5_5.5.55-0+deb8u1_amd64.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> ```

Merci d’avance pour votre aide, n’hésitez pas à me demander plus d’informations

---

<div class="post-metadata">

**Author:** ![jimbo](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/j/d78d45/32.png) [@jimbo](https://www.debian-fr.org/u/jimbo)\
**Post date:** [Mai 16, 2017, 5:19 UTC](https://www.debian-fr.org/t/erreur-lors-de-linstallation-du-paquet-mysql-server/73471/2 "2017-05-16T17:19:23Z")

</div>

apt-get remove --purge mysql-server mysql-common

rm -rf /var/lib/mysql/\*  
rm -rf /etc/mysql/\*

apt-get clean  
apt-get update  
apt-get dist-upgrade

et tu re installe pour autant que tu n’aies pas mélangé les sources

---

<div class="post-metadata">

**Author:** ![BLIDE](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/b/919ad9/32.png) [@BLIDE](https://www.debian-fr.org/u/BLIDE)\
**Post date:** [Mai 17, 2017, 7:05 UTC](https://www.debian-fr.org/t/erreur-lors-de-linstallation-du-paquet-mysql-server/73471/3 "2017-05-17T07:05:45Z")

</div>

Malheureusement même le remove induit en erreur…

```
apt-get remove --purge mysql-server mysql-common

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mysql-server' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libaio1 libdbi-perl libhtml-template-perl libreadline5 libterm-readkey-perl
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  dovecot-mysql* libdbd-mysql-perl* libmysqlclient18* mariadb-client-10.0* mariadb-client-core-10.0* mariadb-common* mariadb-server-10.0* mariadb-server-core-10.0*
  mysql-common* postfix-mysql*
0 upgraded, 0 newly installed, 10 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 135 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 35634 files and directories currently installed.)
Removing mariadb-server-10.0 (10.0.30-0+deb8u2) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mariadb-server-10.0 (--purge):
 subprocess installed pre-removal script returned error exit status 5
Failed to start mysql.service: Unit mysql.service failed to load: No such file or directory.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 6
Removing dovecot-mysql (1:2.2.13-12~deb8u3) ...
Removing libdbd-mysql-perl (4.028-2+deb8u2) ...
Removing postfix-mysql (2.11.3-1+deb8u2) ...
Removing mysql map entry from /etc/postfix/dynamicmaps.cf
Removing libmysqlclient18:amd64 (5.5.55-0+deb8u1) ...
Purging configuration files for libmysqlclient18:amd64 (5.5.55-0+deb8u1) ...
dpkg: mariadb-server-core-10.0: dependency problems, but removing anyway as you requested:
 mariadb-server-10.0 depends on mariadb-server-core-10.0 (>= 10.0.30-0+deb8u2).

Removing mariadb-server-core-10.0 (10.0.30-0+deb8u2) ...
dpkg: mariadb-common: dependency problems, but removing anyway as you requested:
 mariadb-client-core-10.0 depends on mariadb-common.
 mariadb-server-10.0 depends on mariadb-common; however:
  Package mariadb-common is to be removed.

Removing mariadb-common (10.0.30-0+deb8u2) ...
Purging configuration files for mariadb-common (10.0.30-0+deb8u2) ...
Removing mysql-common (5.5.55-0+deb8u1) ...
Purging configuration files for mysql-common (5.5.55-0+deb8u1) ...
dpkg: mariadb-client-10.0: dependency problems, but removing anyway as you requested:
 mariadb-server-10.0 depends on mariadb-client-10.0 (>= 10.0.30-0+deb8u2).

Removing mariadb-client-10.0 (10.0.30-0+deb8u2) ...
Purging configuration files for mariadb-client-10.0 (10.0.30-0+deb8u2) ...
Removing mariadb-client-core-10.0 (10.0.30-0+deb8u2) ...
Processing triggers for dovecot-core (1:2.2.13-12~deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for libc-bin (2.19-18+deb8u9) ...
Errors were encountered while processing:
 mariadb-server-10.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
```
