Não é possível instalar o MySQL no Ubuntu 17.10

0

Tentando instalar o MySQL no Ubuntu 17.10 após remover uma instalação anterior do MariaDB.

Para limpar tudo, eu corri o seguinte:

sudo apt-get remove --purge *mysql*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get remove --purge *mariadb*
sudo apt-get autoremove
sudo apt-get autoclean

Confirmei que o MySQL e o MariaDB foram removidos:

dpkg -l | grep mariadb
dpkg -l | grep mysql

Agora, quando tento reinstalar o MySQL

sudo apt update
sudo apt install mysql-server

Saída:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
libaio1 libevent-core-2.1-6 mysql-client-5.7 mysql-client-core-5.7
mysql-common mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
tinyca
The following NEW packages will be installed:
libaio1 libevent-core-2.1-6 mysql-client-5.7 mysql-client-core-5.7
mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 8 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/20.4 MB of archives.
After this operation, 160 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 281851 files and directories currently installed.)
Preparing to unpack .../0-mysql-common_1%3a10.3.8+maria~artful_all.deb ...
Unpacking mysql-common (1:10.3.8+maria~artful) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../1-libaio1_0.3.110-4_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-4) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../2-mysql-client-  core-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb ...
Unpacking mysql-client-core-5.7 (5.7.22-0ubuntu0.17.10.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../3-mysql-client- 5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb ...
Unpacking mysql-client-5.7 (5.7.22-0ubuntu0.17.10.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../4-mysql-server-   core-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.22-0ubuntu0.17.10.1) ...
Selecting previously unselected package libevent-core-2.1-6:amd64.
Preparing to unpack .../5-libevent-core-2.1-6_2.1.8-stable-4_amd64.deb ...
Unpacking libevent-core-2.1-6:amd64 (2.1.8-stable-4) ...
Setting up mysql-common (1:10.3.8+maria~artful) ...
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 282013 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb   ...
Unpacking mysql-server-5.7 (5.7.22-0ubuntu0.17.10.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.22-0ubuntu0.17.10.1_all.deb ...
Unpacking mysql-server (5.7.22-0ubuntu0.17.10.1) ...
Setting up libevent-core-2.1-6:amd64 (2.1.8-stable-4) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
Setting up libaio1:amd64 (0.3.110-4) ...
Processing triggers for systemd (234-2ubuntu12.4) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up mysql-client-core-5.7 (5.7.22-0ubuntu0.17.10.1) ...
Setting up mysql-server-core-5.7 (5.7.22-0ubuntu0.17.10.1) ...
Setting up mysql-client-5.7 (5.7.22-0ubuntu0.17.10.1) ...
Setting up mysql-server-5.7 (5.7.22-0ubuntu0.17.10.1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-  common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status   127
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a   followup error from a previous failure.
Processing triggers for libc-bin (2.26-0ubuntu2.1)  ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Eu tentei comentar a linha 143 em /var/lib/dpkg/info/mysql-server-5.7.postinst, mas isso não ajudou.

Qualquer ajuda seria muito apreciada. Pensando em usar uma imagem do docker como solução alternativa.

    
por 3even 27.08.2018 / 07:37

1 resposta

0

Então eu consegui instalar com sucesso a última versão do MySQL usando o seguinte.

Mais uma vez, vamos limpar tudo

sudo apt-get remove --purge *mysql*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get remove --purge *mariadb*
sudo apt-get autoremove
sudo apt-get autoclean

e novamente, verificamos que tanto o MySQL quanto o MariaDB foram removidos

dpkg -l | grep mariadb
dpkg -l | grep mysql

Corrija qualquer problema no bloqueio do dpkg seguindo as etapas descritas nesta resposta:

link

Agora obtenha e reinstale o MySQL

cd /tmp/ && wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.3-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server mysql-client
    
por 28.08.2018 / 05:13