Cannot reinstall mysql-server after its purge Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)E: Sub-process /usr/bin/dpkg returned an error code (1) - when using sudo apt-get upgradeMySQL refuses to install (configure?) 16.04How do I uninstall MySQL?The list of running daemonsUnable to purge mysql -serverErrors were encountered while processing: mysql-server-5.7 mysql-serverRemove and reinstall mysqlcannot upgrade kernel and mysql-server after dist upgradeCan not install MySQL on my Ubuntu 12.04Nginx installation error in Ubuntu 16.04mysql doesn't ask for root password when installingMySQL not working after upgrade from 14.04 to 16.04I messed up MySQL. Stuck at ERROR 2002 (HY000) and can't reinstallmysql-server-5.7 configure failsmysql-server-5.5 ErrorAccidentally Removed mysql-server-core-5.7
What causes the vertical darker bands in my photo?
Why did the rest of the Eastern Bloc not invade Yugoslavia?
Identifying polygons that intersect with another layer using QGIS?
Why was the term "discrete" used in discrete logarithm?
Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
How discoverable are IPv6 addresses and AAAA names by potential attackers?
prime numbers and expressing non-prime numbers
Is it true that "carbohydrates are of no use for the basal metabolic need"?
Sci-Fi book where patients in a coma ward all live in a subconscious world linked together
Fundamental Solution of the Pell Equation
How does the particle を relate to the verb 行く in the structure「A を + B に行く」?
How to react to hostile behavior from a senior developer?
Is the Standard Deduction better than Itemized when both are the same amount?
How come Sam didn't become Lord of Horn Hill?
Why aren't air breathing engines used as small first stages
What does this icon in iOS Stardew Valley mean?
Dating a Former Employee
Identify plant with long narrow paired leaves and reddish stems
How to bypass password on Windows XP account?
Why do people hide their license plates in the EU?
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
Why did the IBM 650 use bi-quinary?
What to do with chalk when deepwater soloing?
Cannot reinstall mysql-server after its purge
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)E: Sub-process /usr/bin/dpkg returned an error code (1) - when using sudo apt-get upgradeMySQL refuses to install (configure?) 16.04How do I uninstall MySQL?The list of running daemonsUnable to purge mysql -serverErrors were encountered while processing: mysql-server-5.7 mysql-serverRemove and reinstall mysqlcannot upgrade kernel and mysql-server after dist upgradeCan not install MySQL on my Ubuntu 12.04Nginx installation error in Ubuntu 16.04mysql doesn't ask for root password when installingMySQL not working after upgrade from 14.04 to 16.04I messed up MySQL. Stuck at ERROR 2002 (HY000) and can't reinstallmysql-server-5.7 configure failsmysql-server-5.5 ErrorAccidentally Removed mysql-server-core-5.7
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I recently did a fresh install of Ubuntu 16.04. I also installed mysql-server
and mysql-client
(their default version 5.7.12) via apt-get install
.
Because 5.7.12 was showing some issues, I decided to uninstall it. I tried apt-get remove mysql-server mysql-client
first but saw that artifacts like /etc/mysql
and /var/lib/mysql
didn't get removed.
I then tried apt-get --purge removed mysql-server mysql-client
, but still no difference.
So, I manually removed them (via rm -rf
). I also manually removed all *mysql*
files under /usr/
that came from any mysql-*
dependency packages like mysql-common
.
However, now, when I wish to re-install mysql-server and -client
, I'm finding that I cannot.
In fact, now I'm in a state where I can neither apt-get remove mysql-server
nor apt-get install mysql-server
!
How do fix the situation I am in? If my local package repository metadata has become corrupted, how do I repair it?
I'd hate to reinstall the whole blessed OS with all my other apps and environment, one more time just because of mysql-server
.
The following, for example, is the error I get when I try to remove 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)
And when trying to install, I get this 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)
Here's the output of 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)
mysql 16.04
add a comment |
I recently did a fresh install of Ubuntu 16.04. I also installed mysql-server
and mysql-client
(their default version 5.7.12) via apt-get install
.
Because 5.7.12 was showing some issues, I decided to uninstall it. I tried apt-get remove mysql-server mysql-client
first but saw that artifacts like /etc/mysql
and /var/lib/mysql
didn't get removed.
I then tried apt-get --purge removed mysql-server mysql-client
, but still no difference.
So, I manually removed them (via rm -rf
). I also manually removed all *mysql*
files under /usr/
that came from any mysql-*
dependency packages like mysql-common
.
However, now, when I wish to re-install mysql-server and -client
, I'm finding that I cannot.
In fact, now I'm in a state where I can neither apt-get remove mysql-server
nor apt-get install mysql-server
!
How do fix the situation I am in? If my local package repository metadata has become corrupted, how do I repair it?
I'd hate to reinstall the whole blessed OS with all my other apps and environment, one more time just because of mysql-server
.
The following, for example, is the error I get when I try to remove 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)
And when trying to install, I get this 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)
Here's the output of 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)
mysql 16.04
It looks likemysql-server-5.7
is in a bad state, try to reinstall it:sudo apt-get install --reinstall mysql-server-5.7
.
– fkraiem
Apr 27 '16 at 5:30
Makes no difference, I get the same error line:... invoke-rc.d: initscript mysql, action "start" failed. ...
that I'm getting with other flavors of install commands.
– Harry
Apr 27 '16 at 5:48
Try to remove it, then...sudo apt-get remove --purge mysql-server-5.7
. Note that this is reallymysql-server-5.7
we are talking about, notmysql-server
.
– fkraiem
Apr 27 '16 at 5:49
@Harry Many times, I restart the system to get rid of this type of error.
– d a i s y
Apr 27 '16 at 6:22
My problem solved by following this post
– Raizal I.N. Pregnanta
Apr 7 '17 at 15:16
add a comment |
I recently did a fresh install of Ubuntu 16.04. I also installed mysql-server
and mysql-client
(their default version 5.7.12) via apt-get install
.
Because 5.7.12 was showing some issues, I decided to uninstall it. I tried apt-get remove mysql-server mysql-client
first but saw that artifacts like /etc/mysql
and /var/lib/mysql
didn't get removed.
I then tried apt-get --purge removed mysql-server mysql-client
, but still no difference.
So, I manually removed them (via rm -rf
). I also manually removed all *mysql*
files under /usr/
that came from any mysql-*
dependency packages like mysql-common
.
However, now, when I wish to re-install mysql-server and -client
, I'm finding that I cannot.
In fact, now I'm in a state where I can neither apt-get remove mysql-server
nor apt-get install mysql-server
!
How do fix the situation I am in? If my local package repository metadata has become corrupted, how do I repair it?
I'd hate to reinstall the whole blessed OS with all my other apps and environment, one more time just because of mysql-server
.
The following, for example, is the error I get when I try to remove 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)
And when trying to install, I get this 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)
Here's the output of 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)
mysql 16.04
I recently did a fresh install of Ubuntu 16.04. I also installed mysql-server
and mysql-client
(their default version 5.7.12) via apt-get install
.
Because 5.7.12 was showing some issues, I decided to uninstall it. I tried apt-get remove mysql-server mysql-client
first but saw that artifacts like /etc/mysql
and /var/lib/mysql
didn't get removed.
I then tried apt-get --purge removed mysql-server mysql-client
, but still no difference.
So, I manually removed them (via rm -rf
). I also manually removed all *mysql*
files under /usr/
that came from any mysql-*
dependency packages like mysql-common
.
However, now, when I wish to re-install mysql-server and -client
, I'm finding that I cannot.
In fact, now I'm in a state where I can neither apt-get remove mysql-server
nor apt-get install mysql-server
!
How do fix the situation I am in? If my local package repository metadata has become corrupted, how do I repair it?
I'd hate to reinstall the whole blessed OS with all my other apps and environment, one more time just because of mysql-server
.
The following, for example, is the error I get when I try to remove 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)
And when trying to install, I get this 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)
Here's the output of 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)
mysql 16.04
mysql 16.04
edited Apr 27 '16 at 5:21
Harry
asked Apr 27 '16 at 4:25
HarryHarry
231136
231136
It looks likemysql-server-5.7
is in a bad state, try to reinstall it:sudo apt-get install --reinstall mysql-server-5.7
.
– fkraiem
Apr 27 '16 at 5:30
Makes no difference, I get the same error line:... invoke-rc.d: initscript mysql, action "start" failed. ...
that I'm getting with other flavors of install commands.
– Harry
Apr 27 '16 at 5:48
Try to remove it, then...sudo apt-get remove --purge mysql-server-5.7
. Note that this is reallymysql-server-5.7
we are talking about, notmysql-server
.
– fkraiem
Apr 27 '16 at 5:49
@Harry Many times, I restart the system to get rid of this type of error.
– d a i s y
Apr 27 '16 at 6:22
My problem solved by following this post
– Raizal I.N. Pregnanta
Apr 7 '17 at 15:16
add a comment |
It looks likemysql-server-5.7
is in a bad state, try to reinstall it:sudo apt-get install --reinstall mysql-server-5.7
.
– fkraiem
Apr 27 '16 at 5:30
Makes no difference, I get the same error line:... invoke-rc.d: initscript mysql, action "start" failed. ...
that I'm getting with other flavors of install commands.
– Harry
Apr 27 '16 at 5:48
Try to remove it, then...sudo apt-get remove --purge mysql-server-5.7
. Note that this is reallymysql-server-5.7
we are talking about, notmysql-server
.
– fkraiem
Apr 27 '16 at 5:49
@Harry Many times, I restart the system to get rid of this type of error.
– d a i s y
Apr 27 '16 at 6:22
My problem solved by following this post
– Raizal I.N. Pregnanta
Apr 7 '17 at 15:16
It looks like
mysql-server-5.7
is in a bad state, try to reinstall it: sudo apt-get install --reinstall mysql-server-5.7
.– fkraiem
Apr 27 '16 at 5:30
It looks like
mysql-server-5.7
is in a bad state, try to reinstall it: sudo apt-get install --reinstall mysql-server-5.7
.– fkraiem
Apr 27 '16 at 5:30
Makes no difference, I get the same error line:
... invoke-rc.d: initscript mysql, action "start" failed. ...
that I'm getting with other flavors of install commands.– Harry
Apr 27 '16 at 5:48
Makes no difference, I get the same error line:
... invoke-rc.d: initscript mysql, action "start" failed. ...
that I'm getting with other flavors of install commands.– Harry
Apr 27 '16 at 5:48
Try to remove it, then...
sudo apt-get remove --purge mysql-server-5.7
. Note that this is really mysql-server-5.7
we are talking about, not mysql-server
.– fkraiem
Apr 27 '16 at 5:49
Try to remove it, then...
sudo apt-get remove --purge mysql-server-5.7
. Note that this is really mysql-server-5.7
we are talking about, not mysql-server
.– fkraiem
Apr 27 '16 at 5:49
@Harry Many times, I restart the system to get rid of this type of error.
– d a i s y
Apr 27 '16 at 6:22
@Harry Many times, I restart the system to get rid of this type of error.
– d a i s y
Apr 27 '16 at 6:22
My problem solved by following this post
– Raizal I.N. Pregnanta
Apr 7 '17 at 15:16
My problem solved by following this post
– Raizal I.N. Pregnanta
Apr 7 '17 at 15:16
add a comment |
7 Answers
7
active
oldest
votes
Edited Jan 10 2017: This is a major review of this post to correct serious issues in this post.
The Error at Heart
The problem is that the package is still on the system in an half-installed and half-configured state and needs to be explicitly removed.
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)
What its really saying is that the package mysql-server-5.7
is a dependency for mysql-server
, is already installed, but is not configured. So you need to purge
it to remove those breadcrumbs left behind by mysql-server-5.7
.
sudo apt purge mysql-server mysql-server-5.7
Rationale
When you install software using apt
, it automatically handles dependencies for you as well.
When you remove certain packages, it may not handle those same dependencies. In the case of this post, that dependency is mysql-server-5.7
.
You can check to see a package state by issuing the following command.
dpkg-query -l [package-name-here]
Usually if you see the code un
or rc
to the left of the package name, you'll be able to tell if it actually is a broken package.
When I experienced this issue, it was with libapache2-mod-php
and libapache2-mod-php7.0
. This was my output.
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
un libapache2-mod-php <none> <none> (no description available)
In my case, it claimed that the status of my package is unknown and that it is not installed (the code un
) on my system.
When you tell apt
to remove
something, it can leave packages, configuration files, and other items that can be problematic during automated installations.
When you tell apt
to purge
something it does it's best to remove any breadcrumbs that remove
might have left behind.
I originally stated that I assumed the process was still running, but most likely it was Inactive, or dead.
The best way to check if the service is interfering with your package removal is to check that service first.
1) Investigating the mysql
service
Using the system error given to us by apt
, we can actually use systemctl
to investigate the error by checking on the status of the mysql
service
sudo systemctl status [pattern]
In our case, we want to see if mysql is running so can type in
systemctl status mysql.service
You should see this output if the service is running
systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-10 23:10:06 EST; 1h 3min ago
Main PID: 1206 (mysqld)
CGroup: /system.slice/mysql.service
└─1206 /usr/sbin/mysqld
note: If the service is dead, you'll see a short message indicating that there is no service by that name running and then skip to step 3.
2) Stopping the mysql
service using systemctl
note: [pattern] must be the name listed by service
or initctl
. the reason I use pattern
is because systemctl
uses regex matching, so be careful if you must use the kill
argument.
sudo systemctl stop [pattern]
where pattern
represents the mysql daemon/service name. if stop does not work try
sudo systemctl kill [pattern]
For example
sudo systemctl stop mysql
3) Uninstalling/purging mysql
if you need to totally purge, make sure the service or process is stopped first and then make sure you're removing the right files and directories!
Note: Make sure you are targeting the correct mysql
version. For example, if you use 5.5, adjust the version number appropriately.
WARNING: the following steps will delete your data! (the first command must be executed to do a backup)
source: How do I uninstall MySQL?
tar -zcvf ~/msql_backup.tar.gz /etc/mysql /var/lib/mysql
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rfv /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
4) Fixing broken packages and handling missing dependencies
If the preceding steps did not work for you, you may need to run apt
with the --fix-broken
option to repair any damage done.
Make sure to apt update
first and then apt install
sudo apt update
sudo apt install mysql-server mysql-client --fix-broken --fix-missing
5) When all else fails, build and install mysql
yourself
If none of the above works, you'll have to manually download the source, compile, and use make or bash to install from there (not as painful as it sounds since its all automated).
"16.04 is riddled with loads of bugs right now." Works for me, including MySQL. It seems to me that most of the problems we see here arise from people doing something wrong, like trying torm
files belonging to packages.
– fkraiem
Apr 27 '16 at 10:03
1
Excellent Work buddy! thank you. i wasted my whole day by using some stupid instructions. Now this worked!
– Renjith VR
Jun 23 '16 at 15:25
I have followed your instructions and sudo systemctl stop mysql seemed to work. However after reboot it was broken again. start or stop does not work. sudo systemctl status mysql shows: Active: deactivating (stop-sigterm) since Mon 2016-06-27 11:05:22 BST; 8min ago Do I REALLY have to wait 10 minutes for mysql to stop? Aren't you surprised that people purge a service that didn't fully stop? Is it possible that Ubuntu 16.04 will fix it? What are the options, going back to previous LTS version or another distro?
– ruby_object
Jun 27 '16 at 10:22
Thanks removing and reinstalling this way worked perfectly!
– Louwki
Sep 23 '16 at 11:21
5
note:sudo rm -rf /var/lib/mysql
will remove all your databases in default location. DO a back up first!
– augusto
Oct 10 '16 at 10:54
|
show 6 more comments
The problem with the first post is you can't reconfigure a meta-package well not for the sql items. You need to specify the current release item.
Say use;
apt search mysql-server
That should display a list of packages namely
"mysql-server-5.7" "mysql-server-core-5.7" or later releases
then;
dpkg-reconfigure --force mysql-server-5.7 mysql-server-core-5.7
done.
add a comment |
This is the correct solution for you
First, you will have to remove all packages of mysql-server:
WARNING: the following steps will delete your data! Do a backup first!
sudo rm -rf /var/lib/mysql
Then install:
sudo apt-get install lamp-server^
Or you can do:
sudo apt-get install mysql-server
add a comment |
I saw this
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.
as a clue that there was still an erroneous start-up script in existence.
Look for /etc/init.d/mysql
and any symlinks to it. Removing these appeared to fix my reinstall-after-purge problems.
add a comment |
This error also happened when switching from MySQL to MariaDB (https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071).
The MySQL binary data files were not compatible with MariaDB so I switched back to MySQL because I did not have time to mess with mysqldump.
First I had to move MariaDB data away from /var/lib/mysql
, then install MySQL and then move my original data from /var/lib/mysql-5.7
(this backup was automatically created before the error) to /var/lib/mysql
.
add a comment |
IMPORTANT NOTE
AFTER PURGING AND REMOVING MYSQL. RESTART THE MACHINE.
I REPEAT "RESTART THE MACHINE"
RESTART IS THE FINAL SOLUTION. I have spent sleepless nights figuring why it's not solving.
New contributor
add a comment |
Try apt-get -f install
to fix your broken SQL package and if you are still in problem with package manager download SQL server source code and compile it !!
But try above command and also use dpkg -l | grep sql
to find out package manager still think you SQL or not ..
Did not work. I've also included the error I get when trying to install the package.
– Harry
Apr 27 '16 at 5:03
@Harry You should runapt-get -f install
by itself, without specifying a package name.
– fkraiem
Apr 27 '16 at 5:08
As fkraim said use it with out package name ...
– Ali Ghasempour
Apr 27 '16 at 5:18
Appended the output ofapt-get install -f
, no change.
– Harry
Apr 27 '16 at 5:21
Try synaptic application and check it says there is broken package or not ( on left column )[ if you have desktop ]
– Ali Ghasempour
Apr 27 '16 at 5:26
|
show 1 more comment
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f763534%2fcannot-reinstall-mysql-server-after-its-purge%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
Edited Jan 10 2017: This is a major review of this post to correct serious issues in this post.
The Error at Heart
The problem is that the package is still on the system in an half-installed and half-configured state and needs to be explicitly removed.
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)
What its really saying is that the package mysql-server-5.7
is a dependency for mysql-server
, is already installed, but is not configured. So you need to purge
it to remove those breadcrumbs left behind by mysql-server-5.7
.
sudo apt purge mysql-server mysql-server-5.7
Rationale
When you install software using apt
, it automatically handles dependencies for you as well.
When you remove certain packages, it may not handle those same dependencies. In the case of this post, that dependency is mysql-server-5.7
.
You can check to see a package state by issuing the following command.
dpkg-query -l [package-name-here]
Usually if you see the code un
or rc
to the left of the package name, you'll be able to tell if it actually is a broken package.
When I experienced this issue, it was with libapache2-mod-php
and libapache2-mod-php7.0
. This was my output.
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
un libapache2-mod-php <none> <none> (no description available)
In my case, it claimed that the status of my package is unknown and that it is not installed (the code un
) on my system.
When you tell apt
to remove
something, it can leave packages, configuration files, and other items that can be problematic during automated installations.
When you tell apt
to purge
something it does it's best to remove any breadcrumbs that remove
might have left behind.
I originally stated that I assumed the process was still running, but most likely it was Inactive, or dead.
The best way to check if the service is interfering with your package removal is to check that service first.
1) Investigating the mysql
service
Using the system error given to us by apt
, we can actually use systemctl
to investigate the error by checking on the status of the mysql
service
sudo systemctl status [pattern]
In our case, we want to see if mysql is running so can type in
systemctl status mysql.service
You should see this output if the service is running
systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-10 23:10:06 EST; 1h 3min ago
Main PID: 1206 (mysqld)
CGroup: /system.slice/mysql.service
└─1206 /usr/sbin/mysqld
note: If the service is dead, you'll see a short message indicating that there is no service by that name running and then skip to step 3.
2) Stopping the mysql
service using systemctl
note: [pattern] must be the name listed by service
or initctl
. the reason I use pattern
is because systemctl
uses regex matching, so be careful if you must use the kill
argument.
sudo systemctl stop [pattern]
where pattern
represents the mysql daemon/service name. if stop does not work try
sudo systemctl kill [pattern]
For example
sudo systemctl stop mysql
3) Uninstalling/purging mysql
if you need to totally purge, make sure the service or process is stopped first and then make sure you're removing the right files and directories!
Note: Make sure you are targeting the correct mysql
version. For example, if you use 5.5, adjust the version number appropriately.
WARNING: the following steps will delete your data! (the first command must be executed to do a backup)
source: How do I uninstall MySQL?
tar -zcvf ~/msql_backup.tar.gz /etc/mysql /var/lib/mysql
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rfv /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
4) Fixing broken packages and handling missing dependencies
If the preceding steps did not work for you, you may need to run apt
with the --fix-broken
option to repair any damage done.
Make sure to apt update
first and then apt install
sudo apt update
sudo apt install mysql-server mysql-client --fix-broken --fix-missing
5) When all else fails, build and install mysql
yourself
If none of the above works, you'll have to manually download the source, compile, and use make or bash to install from there (not as painful as it sounds since its all automated).
"16.04 is riddled with loads of bugs right now." Works for me, including MySQL. It seems to me that most of the problems we see here arise from people doing something wrong, like trying torm
files belonging to packages.
– fkraiem
Apr 27 '16 at 10:03
1
Excellent Work buddy! thank you. i wasted my whole day by using some stupid instructions. Now this worked!
– Renjith VR
Jun 23 '16 at 15:25
I have followed your instructions and sudo systemctl stop mysql seemed to work. However after reboot it was broken again. start or stop does not work. sudo systemctl status mysql shows: Active: deactivating (stop-sigterm) since Mon 2016-06-27 11:05:22 BST; 8min ago Do I REALLY have to wait 10 minutes for mysql to stop? Aren't you surprised that people purge a service that didn't fully stop? Is it possible that Ubuntu 16.04 will fix it? What are the options, going back to previous LTS version or another distro?
– ruby_object
Jun 27 '16 at 10:22
Thanks removing and reinstalling this way worked perfectly!
– Louwki
Sep 23 '16 at 11:21
5
note:sudo rm -rf /var/lib/mysql
will remove all your databases in default location. DO a back up first!
– augusto
Oct 10 '16 at 10:54
|
show 6 more comments
Edited Jan 10 2017: This is a major review of this post to correct serious issues in this post.
The Error at Heart
The problem is that the package is still on the system in an half-installed and half-configured state and needs to be explicitly removed.
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)
What its really saying is that the package mysql-server-5.7
is a dependency for mysql-server
, is already installed, but is not configured. So you need to purge
it to remove those breadcrumbs left behind by mysql-server-5.7
.
sudo apt purge mysql-server mysql-server-5.7
Rationale
When you install software using apt
, it automatically handles dependencies for you as well.
When you remove certain packages, it may not handle those same dependencies. In the case of this post, that dependency is mysql-server-5.7
.
You can check to see a package state by issuing the following command.
dpkg-query -l [package-name-here]
Usually if you see the code un
or rc
to the left of the package name, you'll be able to tell if it actually is a broken package.
When I experienced this issue, it was with libapache2-mod-php
and libapache2-mod-php7.0
. This was my output.
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
un libapache2-mod-php <none> <none> (no description available)
In my case, it claimed that the status of my package is unknown and that it is not installed (the code un
) on my system.
When you tell apt
to remove
something, it can leave packages, configuration files, and other items that can be problematic during automated installations.
When you tell apt
to purge
something it does it's best to remove any breadcrumbs that remove
might have left behind.
I originally stated that I assumed the process was still running, but most likely it was Inactive, or dead.
The best way to check if the service is interfering with your package removal is to check that service first.
1) Investigating the mysql
service
Using the system error given to us by apt
, we can actually use systemctl
to investigate the error by checking on the status of the mysql
service
sudo systemctl status [pattern]
In our case, we want to see if mysql is running so can type in
systemctl status mysql.service
You should see this output if the service is running
systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-10 23:10:06 EST; 1h 3min ago
Main PID: 1206 (mysqld)
CGroup: /system.slice/mysql.service
└─1206 /usr/sbin/mysqld
note: If the service is dead, you'll see a short message indicating that there is no service by that name running and then skip to step 3.
2) Stopping the mysql
service using systemctl
note: [pattern] must be the name listed by service
or initctl
. the reason I use pattern
is because systemctl
uses regex matching, so be careful if you must use the kill
argument.
sudo systemctl stop [pattern]
where pattern
represents the mysql daemon/service name. if stop does not work try
sudo systemctl kill [pattern]
For example
sudo systemctl stop mysql
3) Uninstalling/purging mysql
if you need to totally purge, make sure the service or process is stopped first and then make sure you're removing the right files and directories!
Note: Make sure you are targeting the correct mysql
version. For example, if you use 5.5, adjust the version number appropriately.
WARNING: the following steps will delete your data! (the first command must be executed to do a backup)
source: How do I uninstall MySQL?
tar -zcvf ~/msql_backup.tar.gz /etc/mysql /var/lib/mysql
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rfv /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
4) Fixing broken packages and handling missing dependencies
If the preceding steps did not work for you, you may need to run apt
with the --fix-broken
option to repair any damage done.
Make sure to apt update
first and then apt install
sudo apt update
sudo apt install mysql-server mysql-client --fix-broken --fix-missing
5) When all else fails, build and install mysql
yourself
If none of the above works, you'll have to manually download the source, compile, and use make or bash to install from there (not as painful as it sounds since its all automated).
"16.04 is riddled with loads of bugs right now." Works for me, including MySQL. It seems to me that most of the problems we see here arise from people doing something wrong, like trying torm
files belonging to packages.
– fkraiem
Apr 27 '16 at 10:03
1
Excellent Work buddy! thank you. i wasted my whole day by using some stupid instructions. Now this worked!
– Renjith VR
Jun 23 '16 at 15:25
I have followed your instructions and sudo systemctl stop mysql seemed to work. However after reboot it was broken again. start or stop does not work. sudo systemctl status mysql shows: Active: deactivating (stop-sigterm) since Mon 2016-06-27 11:05:22 BST; 8min ago Do I REALLY have to wait 10 minutes for mysql to stop? Aren't you surprised that people purge a service that didn't fully stop? Is it possible that Ubuntu 16.04 will fix it? What are the options, going back to previous LTS version or another distro?
– ruby_object
Jun 27 '16 at 10:22
Thanks removing and reinstalling this way worked perfectly!
– Louwki
Sep 23 '16 at 11:21
5
note:sudo rm -rf /var/lib/mysql
will remove all your databases in default location. DO a back up first!
– augusto
Oct 10 '16 at 10:54
|
show 6 more comments
Edited Jan 10 2017: This is a major review of this post to correct serious issues in this post.
The Error at Heart
The problem is that the package is still on the system in an half-installed and half-configured state and needs to be explicitly removed.
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)
What its really saying is that the package mysql-server-5.7
is a dependency for mysql-server
, is already installed, but is not configured. So you need to purge
it to remove those breadcrumbs left behind by mysql-server-5.7
.
sudo apt purge mysql-server mysql-server-5.7
Rationale
When you install software using apt
, it automatically handles dependencies for you as well.
When you remove certain packages, it may not handle those same dependencies. In the case of this post, that dependency is mysql-server-5.7
.
You can check to see a package state by issuing the following command.
dpkg-query -l [package-name-here]
Usually if you see the code un
or rc
to the left of the package name, you'll be able to tell if it actually is a broken package.
When I experienced this issue, it was with libapache2-mod-php
and libapache2-mod-php7.0
. This was my output.
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
un libapache2-mod-php <none> <none> (no description available)
In my case, it claimed that the status of my package is unknown and that it is not installed (the code un
) on my system.
When you tell apt
to remove
something, it can leave packages, configuration files, and other items that can be problematic during automated installations.
When you tell apt
to purge
something it does it's best to remove any breadcrumbs that remove
might have left behind.
I originally stated that I assumed the process was still running, but most likely it was Inactive, or dead.
The best way to check if the service is interfering with your package removal is to check that service first.
1) Investigating the mysql
service
Using the system error given to us by apt
, we can actually use systemctl
to investigate the error by checking on the status of the mysql
service
sudo systemctl status [pattern]
In our case, we want to see if mysql is running so can type in
systemctl status mysql.service
You should see this output if the service is running
systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-10 23:10:06 EST; 1h 3min ago
Main PID: 1206 (mysqld)
CGroup: /system.slice/mysql.service
└─1206 /usr/sbin/mysqld
note: If the service is dead, you'll see a short message indicating that there is no service by that name running and then skip to step 3.
2) Stopping the mysql
service using systemctl
note: [pattern] must be the name listed by service
or initctl
. the reason I use pattern
is because systemctl
uses regex matching, so be careful if you must use the kill
argument.
sudo systemctl stop [pattern]
where pattern
represents the mysql daemon/service name. if stop does not work try
sudo systemctl kill [pattern]
For example
sudo systemctl stop mysql
3) Uninstalling/purging mysql
if you need to totally purge, make sure the service or process is stopped first and then make sure you're removing the right files and directories!
Note: Make sure you are targeting the correct mysql
version. For example, if you use 5.5, adjust the version number appropriately.
WARNING: the following steps will delete your data! (the first command must be executed to do a backup)
source: How do I uninstall MySQL?
tar -zcvf ~/msql_backup.tar.gz /etc/mysql /var/lib/mysql
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rfv /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
4) Fixing broken packages and handling missing dependencies
If the preceding steps did not work for you, you may need to run apt
with the --fix-broken
option to repair any damage done.
Make sure to apt update
first and then apt install
sudo apt update
sudo apt install mysql-server mysql-client --fix-broken --fix-missing
5) When all else fails, build and install mysql
yourself
If none of the above works, you'll have to manually download the source, compile, and use make or bash to install from there (not as painful as it sounds since its all automated).
Edited Jan 10 2017: This is a major review of this post to correct serious issues in this post.
The Error at Heart
The problem is that the package is still on the system in an half-installed and half-configured state and needs to be explicitly removed.
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)
What its really saying is that the package mysql-server-5.7
is a dependency for mysql-server
, is already installed, but is not configured. So you need to purge
it to remove those breadcrumbs left behind by mysql-server-5.7
.
sudo apt purge mysql-server mysql-server-5.7
Rationale
When you install software using apt
, it automatically handles dependencies for you as well.
When you remove certain packages, it may not handle those same dependencies. In the case of this post, that dependency is mysql-server-5.7
.
You can check to see a package state by issuing the following command.
dpkg-query -l [package-name-here]
Usually if you see the code un
or rc
to the left of the package name, you'll be able to tell if it actually is a broken package.
When I experienced this issue, it was with libapache2-mod-php
and libapache2-mod-php7.0
. This was my output.
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
un libapache2-mod-php <none> <none> (no description available)
In my case, it claimed that the status of my package is unknown and that it is not installed (the code un
) on my system.
When you tell apt
to remove
something, it can leave packages, configuration files, and other items that can be problematic during automated installations.
When you tell apt
to purge
something it does it's best to remove any breadcrumbs that remove
might have left behind.
I originally stated that I assumed the process was still running, but most likely it was Inactive, or dead.
The best way to check if the service is interfering with your package removal is to check that service first.
1) Investigating the mysql
service
Using the system error given to us by apt
, we can actually use systemctl
to investigate the error by checking on the status of the mysql
service
sudo systemctl status [pattern]
In our case, we want to see if mysql is running so can type in
systemctl status mysql.service
You should see this output if the service is running
systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-10 23:10:06 EST; 1h 3min ago
Main PID: 1206 (mysqld)
CGroup: /system.slice/mysql.service
└─1206 /usr/sbin/mysqld
note: If the service is dead, you'll see a short message indicating that there is no service by that name running and then skip to step 3.
2) Stopping the mysql
service using systemctl
note: [pattern] must be the name listed by service
or initctl
. the reason I use pattern
is because systemctl
uses regex matching, so be careful if you must use the kill
argument.
sudo systemctl stop [pattern]
where pattern
represents the mysql daemon/service name. if stop does not work try
sudo systemctl kill [pattern]
For example
sudo systemctl stop mysql
3) Uninstalling/purging mysql
if you need to totally purge, make sure the service or process is stopped first and then make sure you're removing the right files and directories!
Note: Make sure you are targeting the correct mysql
version. For example, if you use 5.5, adjust the version number appropriately.
WARNING: the following steps will delete your data! (the first command must be executed to do a backup)
source: How do I uninstall MySQL?
tar -zcvf ~/msql_backup.tar.gz /etc/mysql /var/lib/mysql
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rfv /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
4) Fixing broken packages and handling missing dependencies
If the preceding steps did not work for you, you may need to run apt
with the --fix-broken
option to repair any damage done.
Make sure to apt update
first and then apt install
sudo apt update
sudo apt install mysql-server mysql-client --fix-broken --fix-missing
5) When all else fails, build and install mysql
yourself
If none of the above works, you'll have to manually download the source, compile, and use make or bash to install from there (not as painful as it sounds since its all automated).
edited Nov 6 '17 at 18:33
David Foerster
28.7k1367113
28.7k1367113
answered Apr 27 '16 at 8:46
user383919
"16.04 is riddled with loads of bugs right now." Works for me, including MySQL. It seems to me that most of the problems we see here arise from people doing something wrong, like trying torm
files belonging to packages.
– fkraiem
Apr 27 '16 at 10:03
1
Excellent Work buddy! thank you. i wasted my whole day by using some stupid instructions. Now this worked!
– Renjith VR
Jun 23 '16 at 15:25
I have followed your instructions and sudo systemctl stop mysql seemed to work. However after reboot it was broken again. start or stop does not work. sudo systemctl status mysql shows: Active: deactivating (stop-sigterm) since Mon 2016-06-27 11:05:22 BST; 8min ago Do I REALLY have to wait 10 minutes for mysql to stop? Aren't you surprised that people purge a service that didn't fully stop? Is it possible that Ubuntu 16.04 will fix it? What are the options, going back to previous LTS version or another distro?
– ruby_object
Jun 27 '16 at 10:22
Thanks removing and reinstalling this way worked perfectly!
– Louwki
Sep 23 '16 at 11:21
5
note:sudo rm -rf /var/lib/mysql
will remove all your databases in default location. DO a back up first!
– augusto
Oct 10 '16 at 10:54
|
show 6 more comments
"16.04 is riddled with loads of bugs right now." Works for me, including MySQL. It seems to me that most of the problems we see here arise from people doing something wrong, like trying torm
files belonging to packages.
– fkraiem
Apr 27 '16 at 10:03
1
Excellent Work buddy! thank you. i wasted my whole day by using some stupid instructions. Now this worked!
– Renjith VR
Jun 23 '16 at 15:25
I have followed your instructions and sudo systemctl stop mysql seemed to work. However after reboot it was broken again. start or stop does not work. sudo systemctl status mysql shows: Active: deactivating (stop-sigterm) since Mon 2016-06-27 11:05:22 BST; 8min ago Do I REALLY have to wait 10 minutes for mysql to stop? Aren't you surprised that people purge a service that didn't fully stop? Is it possible that Ubuntu 16.04 will fix it? What are the options, going back to previous LTS version or another distro?
– ruby_object
Jun 27 '16 at 10:22
Thanks removing and reinstalling this way worked perfectly!
– Louwki
Sep 23 '16 at 11:21
5
note:sudo rm -rf /var/lib/mysql
will remove all your databases in default location. DO a back up first!
– augusto
Oct 10 '16 at 10:54
"16.04 is riddled with loads of bugs right now." Works for me, including MySQL. It seems to me that most of the problems we see here arise from people doing something wrong, like trying to
rm
files belonging to packages.– fkraiem
Apr 27 '16 at 10:03
"16.04 is riddled with loads of bugs right now." Works for me, including MySQL. It seems to me that most of the problems we see here arise from people doing something wrong, like trying to
rm
files belonging to packages.– fkraiem
Apr 27 '16 at 10:03
1
1
Excellent Work buddy! thank you. i wasted my whole day by using some stupid instructions. Now this worked!
– Renjith VR
Jun 23 '16 at 15:25
Excellent Work buddy! thank you. i wasted my whole day by using some stupid instructions. Now this worked!
– Renjith VR
Jun 23 '16 at 15:25
I have followed your instructions and sudo systemctl stop mysql seemed to work. However after reboot it was broken again. start or stop does not work. sudo systemctl status mysql shows: Active: deactivating (stop-sigterm) since Mon 2016-06-27 11:05:22 BST; 8min ago Do I REALLY have to wait 10 minutes for mysql to stop? Aren't you surprised that people purge a service that didn't fully stop? Is it possible that Ubuntu 16.04 will fix it? What are the options, going back to previous LTS version or another distro?
– ruby_object
Jun 27 '16 at 10:22
I have followed your instructions and sudo systemctl stop mysql seemed to work. However after reboot it was broken again. start or stop does not work. sudo systemctl status mysql shows: Active: deactivating (stop-sigterm) since Mon 2016-06-27 11:05:22 BST; 8min ago Do I REALLY have to wait 10 minutes for mysql to stop? Aren't you surprised that people purge a service that didn't fully stop? Is it possible that Ubuntu 16.04 will fix it? What are the options, going back to previous LTS version or another distro?
– ruby_object
Jun 27 '16 at 10:22
Thanks removing and reinstalling this way worked perfectly!
– Louwki
Sep 23 '16 at 11:21
Thanks removing and reinstalling this way worked perfectly!
– Louwki
Sep 23 '16 at 11:21
5
5
note:
sudo rm -rf /var/lib/mysql
will remove all your databases in default location. DO a back up first!– augusto
Oct 10 '16 at 10:54
note:
sudo rm -rf /var/lib/mysql
will remove all your databases in default location. DO a back up first!– augusto
Oct 10 '16 at 10:54
|
show 6 more comments
The problem with the first post is you can't reconfigure a meta-package well not for the sql items. You need to specify the current release item.
Say use;
apt search mysql-server
That should display a list of packages namely
"mysql-server-5.7" "mysql-server-core-5.7" or later releases
then;
dpkg-reconfigure --force mysql-server-5.7 mysql-server-core-5.7
done.
add a comment |
The problem with the first post is you can't reconfigure a meta-package well not for the sql items. You need to specify the current release item.
Say use;
apt search mysql-server
That should display a list of packages namely
"mysql-server-5.7" "mysql-server-core-5.7" or later releases
then;
dpkg-reconfigure --force mysql-server-5.7 mysql-server-core-5.7
done.
add a comment |
The problem with the first post is you can't reconfigure a meta-package well not for the sql items. You need to specify the current release item.
Say use;
apt search mysql-server
That should display a list of packages namely
"mysql-server-5.7" "mysql-server-core-5.7" or later releases
then;
dpkg-reconfigure --force mysql-server-5.7 mysql-server-core-5.7
done.
The problem with the first post is you can't reconfigure a meta-package well not for the sql items. You need to specify the current release item.
Say use;
apt search mysql-server
That should display a list of packages namely
"mysql-server-5.7" "mysql-server-core-5.7" or later releases
then;
dpkg-reconfigure --force mysql-server-5.7 mysql-server-core-5.7
done.
answered Mar 16 '17 at 16:52
e8hffffe8hffff
7111
7111
add a comment |
add a comment |
This is the correct solution for you
First, you will have to remove all packages of mysql-server:
WARNING: the following steps will delete your data! Do a backup first!
sudo rm -rf /var/lib/mysql
Then install:
sudo apt-get install lamp-server^
Or you can do:
sudo apt-get install mysql-server
add a comment |
This is the correct solution for you
First, you will have to remove all packages of mysql-server:
WARNING: the following steps will delete your data! Do a backup first!
sudo rm -rf /var/lib/mysql
Then install:
sudo apt-get install lamp-server^
Or you can do:
sudo apt-get install mysql-server
add a comment |
This is the correct solution for you
First, you will have to remove all packages of mysql-server:
WARNING: the following steps will delete your data! Do a backup first!
sudo rm -rf /var/lib/mysql
Then install:
sudo apt-get install lamp-server^
Or you can do:
sudo apt-get install mysql-server
This is the correct solution for you
First, you will have to remove all packages of mysql-server:
WARNING: the following steps will delete your data! Do a backup first!
sudo rm -rf /var/lib/mysql
Then install:
sudo apt-get install lamp-server^
Or you can do:
sudo apt-get install mysql-server
edited Jan 26 at 13:18
Erfan Jazeb Nikoo
1034
1034
answered Jul 14 '17 at 11:21
RohanRohan
454
454
add a comment |
add a comment |
I saw this
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.
as a clue that there was still an erroneous start-up script in existence.
Look for /etc/init.d/mysql
and any symlinks to it. Removing these appeared to fix my reinstall-after-purge problems.
add a comment |
I saw this
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.
as a clue that there was still an erroneous start-up script in existence.
Look for /etc/init.d/mysql
and any symlinks to it. Removing these appeared to fix my reinstall-after-purge problems.
add a comment |
I saw this
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.
as a clue that there was still an erroneous start-up script in existence.
Look for /etc/init.d/mysql
and any symlinks to it. Removing these appeared to fix my reinstall-after-purge problems.
I saw this
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.
as a clue that there was still an erroneous start-up script in existence.
Look for /etc/init.d/mysql
and any symlinks to it. Removing these appeared to fix my reinstall-after-purge problems.
answered Jun 22 '16 at 21:04
ghatzhatghatzhat
11
11
add a comment |
add a comment |
This error also happened when switching from MySQL to MariaDB (https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071).
The MySQL binary data files were not compatible with MariaDB so I switched back to MySQL because I did not have time to mess with mysqldump.
First I had to move MariaDB data away from /var/lib/mysql
, then install MySQL and then move my original data from /var/lib/mysql-5.7
(this backup was automatically created before the error) to /var/lib/mysql
.
add a comment |
This error also happened when switching from MySQL to MariaDB (https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071).
The MySQL binary data files were not compatible with MariaDB so I switched back to MySQL because I did not have time to mess with mysqldump.
First I had to move MariaDB data away from /var/lib/mysql
, then install MySQL and then move my original data from /var/lib/mysql-5.7
(this backup was automatically created before the error) to /var/lib/mysql
.
add a comment |
This error also happened when switching from MySQL to MariaDB (https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071).
The MySQL binary data files were not compatible with MariaDB so I switched back to MySQL because I did not have time to mess with mysqldump.
First I had to move MariaDB data away from /var/lib/mysql
, then install MySQL and then move my original data from /var/lib/mysql-5.7
(this backup was automatically created before the error) to /var/lib/mysql
.
This error also happened when switching from MySQL to MariaDB (https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071).
The MySQL binary data files were not compatible with MariaDB so I switched back to MySQL because I did not have time to mess with mysqldump.
First I had to move MariaDB data away from /var/lib/mysql
, then install MySQL and then move my original data from /var/lib/mysql-5.7
(this backup was automatically created before the error) to /var/lib/mysql
.
edited Nov 6 '17 at 18:04
answered Nov 6 '17 at 16:52
baptxbaptx
1057
1057
add a comment |
add a comment |
IMPORTANT NOTE
AFTER PURGING AND REMOVING MYSQL. RESTART THE MACHINE.
I REPEAT "RESTART THE MACHINE"
RESTART IS THE FINAL SOLUTION. I have spent sleepless nights figuring why it's not solving.
New contributor
add a comment |
IMPORTANT NOTE
AFTER PURGING AND REMOVING MYSQL. RESTART THE MACHINE.
I REPEAT "RESTART THE MACHINE"
RESTART IS THE FINAL SOLUTION. I have spent sleepless nights figuring why it's not solving.
New contributor
add a comment |
IMPORTANT NOTE
AFTER PURGING AND REMOVING MYSQL. RESTART THE MACHINE.
I REPEAT "RESTART THE MACHINE"
RESTART IS THE FINAL SOLUTION. I have spent sleepless nights figuring why it's not solving.
New contributor
IMPORTANT NOTE
AFTER PURGING AND REMOVING MYSQL. RESTART THE MACHINE.
I REPEAT "RESTART THE MACHINE"
RESTART IS THE FINAL SOLUTION. I have spent sleepless nights figuring why it's not solving.
New contributor
New contributor
answered 2 hours ago
Zahid L ShaikhZahid L Shaikh
1
1
New contributor
New contributor
add a comment |
add a comment |
Try apt-get -f install
to fix your broken SQL package and if you are still in problem with package manager download SQL server source code and compile it !!
But try above command and also use dpkg -l | grep sql
to find out package manager still think you SQL or not ..
Did not work. I've also included the error I get when trying to install the package.
– Harry
Apr 27 '16 at 5:03
@Harry You should runapt-get -f install
by itself, without specifying a package name.
– fkraiem
Apr 27 '16 at 5:08
As fkraim said use it with out package name ...
– Ali Ghasempour
Apr 27 '16 at 5:18
Appended the output ofapt-get install -f
, no change.
– Harry
Apr 27 '16 at 5:21
Try synaptic application and check it says there is broken package or not ( on left column )[ if you have desktop ]
– Ali Ghasempour
Apr 27 '16 at 5:26
|
show 1 more comment
Try apt-get -f install
to fix your broken SQL package and if you are still in problem with package manager download SQL server source code and compile it !!
But try above command and also use dpkg -l | grep sql
to find out package manager still think you SQL or not ..
Did not work. I've also included the error I get when trying to install the package.
– Harry
Apr 27 '16 at 5:03
@Harry You should runapt-get -f install
by itself, without specifying a package name.
– fkraiem
Apr 27 '16 at 5:08
As fkraim said use it with out package name ...
– Ali Ghasempour
Apr 27 '16 at 5:18
Appended the output ofapt-get install -f
, no change.
– Harry
Apr 27 '16 at 5:21
Try synaptic application and check it says there is broken package or not ( on left column )[ if you have desktop ]
– Ali Ghasempour
Apr 27 '16 at 5:26
|
show 1 more comment
Try apt-get -f install
to fix your broken SQL package and if you are still in problem with package manager download SQL server source code and compile it !!
But try above command and also use dpkg -l | grep sql
to find out package manager still think you SQL or not ..
Try apt-get -f install
to fix your broken SQL package and if you are still in problem with package manager download SQL server source code and compile it !!
But try above command and also use dpkg -l | grep sql
to find out package manager still think you SQL or not ..
answered Apr 27 '16 at 4:35
Ali GhasempourAli Ghasempour
36127
36127
Did not work. I've also included the error I get when trying to install the package.
– Harry
Apr 27 '16 at 5:03
@Harry You should runapt-get -f install
by itself, without specifying a package name.
– fkraiem
Apr 27 '16 at 5:08
As fkraim said use it with out package name ...
– Ali Ghasempour
Apr 27 '16 at 5:18
Appended the output ofapt-get install -f
, no change.
– Harry
Apr 27 '16 at 5:21
Try synaptic application and check it says there is broken package or not ( on left column )[ if you have desktop ]
– Ali Ghasempour
Apr 27 '16 at 5:26
|
show 1 more comment
Did not work. I've also included the error I get when trying to install the package.
– Harry
Apr 27 '16 at 5:03
@Harry You should runapt-get -f install
by itself, without specifying a package name.
– fkraiem
Apr 27 '16 at 5:08
As fkraim said use it with out package name ...
– Ali Ghasempour
Apr 27 '16 at 5:18
Appended the output ofapt-get install -f
, no change.
– Harry
Apr 27 '16 at 5:21
Try synaptic application and check it says there is broken package or not ( on left column )[ if you have desktop ]
– Ali Ghasempour
Apr 27 '16 at 5:26
Did not work. I've also included the error I get when trying to install the package.
– Harry
Apr 27 '16 at 5:03
Did not work. I've also included the error I get when trying to install the package.
– Harry
Apr 27 '16 at 5:03
@Harry You should run
apt-get -f install
by itself, without specifying a package name.– fkraiem
Apr 27 '16 at 5:08
@Harry You should run
apt-get -f install
by itself, without specifying a package name.– fkraiem
Apr 27 '16 at 5:08
As fkraim said use it with out package name ...
– Ali Ghasempour
Apr 27 '16 at 5:18
As fkraim said use it with out package name ...
– Ali Ghasempour
Apr 27 '16 at 5:18
Appended the output of
apt-get install -f
, no change.– Harry
Apr 27 '16 at 5:21
Appended the output of
apt-get install -f
, no change.– Harry
Apr 27 '16 at 5:21
Try synaptic application and check it says there is broken package or not ( on left column )[ if you have desktop ]
– Ali Ghasempour
Apr 27 '16 at 5:26
Try synaptic application and check it says there is broken package or not ( on left column )[ if you have desktop ]
– Ali Ghasempour
Apr 27 '16 at 5:26
|
show 1 more comment
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f763534%2fcannot-reinstall-mysql-server-after-its-purge%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It looks like
mysql-server-5.7
is in a bad state, try to reinstall it:sudo apt-get install --reinstall mysql-server-5.7
.– fkraiem
Apr 27 '16 at 5:30
Makes no difference, I get the same error line:
... invoke-rc.d: initscript mysql, action "start" failed. ...
that I'm getting with other flavors of install commands.– Harry
Apr 27 '16 at 5:48
Try to remove it, then...
sudo apt-get remove --purge mysql-server-5.7
. Note that this is reallymysql-server-5.7
we are talking about, notmysql-server
.– fkraiem
Apr 27 '16 at 5:49
@Harry Many times, I restart the system to get rid of this type of error.
– d a i s y
Apr 27 '16 at 6:22
My problem solved by following this post
– Raizal I.N. Pregnanta
Apr 7 '17 at 15:16