Después de actualizar a Ubuntu 16.04, noté que mysql tenía errores alucinantes. Convencido, era una configuración rota, intenté ejecutar una purga de mysql. Eso no pareció eliminar todo, así que intenté hacerlo yo mismo:
sudo rm -r /etc/mysql
sudo rm -r /usr/share/mysql-workbench
sudo rm -r /usr/share/mysql
sudo rm -r /usr/share/mysql-common
Esto fue un error. NUNCA intentes hacer esto. Ahora mysql ni siquiera se instalará correctamente. He intentado reinstalar las dependencias:
sudo apt-get install --reinstall $(apt-cache depends mysql-server | grep -Po 'Depends:\s+\K[^ ]+$' | tr '\n' ' ' )
Y los paquetes en sí:
sudo apt install mysql-workbench mysql-server --reinstall
Pero obtengo todo tipo de errores crípticos, como:
sudo apt-get install --reinstall mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 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.
E: Internal Error, No file name for mysql-server:amd64
Y desinstalar
sudo apt-get remove mysql-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libmysqlclient20 : Depends: mysql-common (>= 5.5) but it is not going to be installed
mariadb-client-core-10.0 : Depends: mariadb-common (>= 10.0.24-7) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
O si reconfigurar
sudo dpkg --configure -a
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 112: /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 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
Errors were encountered while processing:
mysql-server-5.7
mysql-server
O si forzo la instalación:
sudo apt-get -f install
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) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 112: /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 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)
O si hago una purga:
sudo apt-get -f purge mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
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] y
(Reading database ... 348226 files and directories currently installed.)
Removing mysql-server (5.7.12-0ubuntu1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 112: /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 1
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)
¿Es apto incapaz de recuperarse de una instalación parcial? ¿Tengo que reinstalar el sistema operativo?
apt
package-management
mysql
Jonathan
fuente
fuente
sudo apt-get install --reinstall mysql
?Respuestas:
Haga lo siguiente para limpiar los paquetes rotos:
Después de eso, vuelva a instalarlo con:
fuente
Gracias a @Videonauth
Luego corriendo:
Si algo falla, simplemente ejecute
sudo dpkg -r <failedpackage>
y si ESO falla, simplemente elimine el paquete que depende de él. Si repite, eventualmente apt-get funcionará nuevamente.Consulte también ¿Cuál es la diferencia entre dpkg y aptitude / apt-get?
fuente
Prueba esto,
ejecuta este comando para purgar mysql, reemplaza la versión 5.7 con tu versión instalada
ejecutar esto para limpiar y actualizar paquetes
finalmente instale mysql
Esto funcionó para mí.
fuente
sudo dpkg -r mysql-client-5.7
)Después de purgar
mysql
como se ha mostrado anteriormente, debe instalar mysql de esta manera:Cuando instale de esta manera, no tendrá un error de instalación.
fuente
No sé la razón exacta, pero todos estos métodos no funcionaron para mí. En mi caso, el procedimiento que corrigió el problema fue:
y reiniciar !
¡por fin he podido correr
sudo apt-get install mysql-server
!fuente
Esto funciono para mi
Luego de eso instalé MySQL nuevamente con
sudo apt-get install mysql-server
y ahora está funcionando bien.fuente
El comando sudo dpkg -r no funciona para mí.
Solía
sudo apt-get purge mysql-*
desinstalar todas las páginas publicadas y luego reinstalarlasfuente