Recientemente hice una nueva instalación de Ubuntu 16.04. También instalé mysql-server
y mysql-client
(su versión predeterminada 5.7.12) a través de apt-get install
.
Debido a que 5.7.12 mostraba algunos problemas, decidí desinstalarlo. Lo intenté apt-get remove mysql-server mysql-client
primero pero vi que a los artefactos les gustaba /etc/mysql
y /var/lib/mysql
no me los quitaban.
Entonces lo intenté apt-get --purge removed mysql-server mysql-client
, pero aún no hay diferencia.
Entonces, los eliminé manualmente (a través de rm -rf
). También eliminé manualmente todos los *mysql*
archivos /usr/
que vinieron de cualquier mysql-*
paquete de dependencia como mysql-common
.
Sin embargo, ahora, cuando deseo volver a instalar mysql-server and -client
, descubro que no puedo.
De hecho, ¡ahora estoy en un estado donde no puedo apt-get remove mysql-server
ni apt-get install mysql-server
!
¿Cómo soluciono la situación en la que estoy? Si mis metadatos del repositorio de paquetes local se han dañado, ¿cómo lo reparo?
Odiaría reinstalar todo el SO bendito con todas mis otras aplicaciones y entorno, una vez más solo por eso mysql-server
.
El siguiente, por ejemplo, es el error que obtengo cuando intento eliminar mysql-server
:
$ apt-get remove mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libaio1 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
mysql-server
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 159 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 237601 files and directories currently installed.)
Removing mysql-server (5.7.12-0ubuntu1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)
Y cuando intento instalar, me sale este error:
$ apt-get -f install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
mysql-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/10.1 kB of archives.
After this operation, 159 kB of additional disk space will be used.
Selecting previously unselected package mysql-server.
(Reading database ... 237599 files and directories currently installed.)
Preparing to unpack .../mysql-server_5.7.12-0ubuntu1_all.deb ...
Unpacking mysql-server (5.7.12-0ubuntu1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
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.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Aquí está la salida de apt-get install -f
:
$ apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
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.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
... invoke-rc.d: initscript mysql, action "start" failed. ...
que obtengo con otros tipos de comandos de instalación.
sudo apt-get remove --purge mysql-server-5.7
. Tenga en cuenta que esto es realmente de lo mysql-server-5.7
que estamos hablando, no mysql-server
.
mysql-server-5.7
está en mal estado, intente volver a instalarlo:sudo apt-get install --reinstall mysql-server-5.7
.