Di recente ho fatto una nuova installazione di Ubuntu 16.04. Ho anche installato mysql-server
e mysql-client
(la loro versione predefinita 5.7.12) tramite apt-get install
.
Poiché 5.7.12 mostrava alcuni problemi, ho deciso di disinstallarlo. apt-get remove mysql-server mysql-client
Prima ho provato ma ho visto che gli artefatti piacciono /etc/mysql
e /var/lib/mysql
non vengono rimossi.
Ho quindi provato apt-get --purge removed mysql-server mysql-client
, ma ancora nessuna differenza.
Quindi, li ho rimossi manualmente (via rm -rf
). Ho anche rimosso manualmente tutti i *mysql*
file /usr/
che provenivano da qualsiasi mysql-*
pacchetto di dipendenze come mysql-common
.
Tuttavia, ora, quando desidero reinstallare mysql-server and -client
, sto scoprendo che non posso.
In effetti, ora sono in uno stato in cui non posso né apt-get remove mysql-server
né apt-get install mysql-server
!
Come posso risolvere la situazione in cui mi trovo? Se i metadati del repository del mio pacchetto locale sono stati danneggiati, come posso ripararlo?
Odierei reinstallare l'intero sistema operativo benedetto con tutte le altre app e l'ambiente, ancora una volta proprio per questo mysql-server
.
Quanto segue, ad esempio, è l'errore che ottengo quando provo a rimuovere 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)
E quando provo ad installare, ottengo questo errore:
$ 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)
Ecco l'output di 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. ...
che ottengo con altri tipi di comandi di installazione.
sudo apt-get remove --purge mysql-server-5.7
. Si noti che questo è davvero di mysql-server-5.7
cui stiamo parlando, non mysql-server
.
mysql-server-5.7
è in cattivo stato, provare a reinstallarlo:sudo apt-get install --reinstall mysql-server-5.7
.