How to repair corrupt package installation (mysql)Errors were encountered while processing: mysql-server-5.7 mysql-server16.04 upgrade broke mysql-serverWhat is the difference between dpkg and aptitude/apt-get?“sudo apt-get purge mysql” Failing on Ubuntu 16.04 LTSWhat to do with --force?Unable to install mysql 5.7 in ubuntu 5.7cannot upgrade kernel and mysql-server after dist upgradeCan not install MySQL on my Ubuntu 12.04Cannot install anything! Unmet dependencies. Libre OfficeProblem installing apache2MySql Installation problem in dual boot ubuntu 14.04mysql doesn't ask for root password when installingmysql-server-5.5 ErrorUnable to install MariaDB on circleCI ? Problems with dpkg.mysql-server-5.7 package post-installation script subprocess returned error exit status 127dpkg: error processing package sendmail-base

Why didn't Trudy wear a breathing mask in Avatar?

Why does allocating a single 2D array take longer than a loop allocating multiple 1D arrays of the same total size and shape?

Abuse of Illusory Reality

How to handle motorists' dangerous behaviour with an impassable group?

Scalar `new T` vs array `new T[1]`

Understanding and grammar meaning behind "やったことないしなー"

Can a Creature at 0 HP Take Damage?

Should I withdraw my paper because the Editor is behaving so badly with me?

Can massive damage kill you while at 0 HP?

How can I remove rest of file from string for all files?

Rat proofing compost bin but allowing worms in

one-liner vs script

What are the bars protruding from this C-130?

how do you value what your leisure time is worth?

Can I perform Umrah while on a Saudi Arabian visit e-visa

How to discipline overeager engineer

Minimum number of MPs

Can I color text by using an image, so that the color isn't flat?

If LPG gas burners can reach temperatures above 1700 °C, then how do HCA and PAH not develop in extreme amounts during cooking?

Can I bring alcohol to Dubai?

How to construct the Moore spectrum?

What if you can't publish in very high impact journal or top conference during your PhD?

This fell out of my toilet when I unscrewed the supply line. What is it?

What is the fastest way to move in Borderlands 3?



How to repair corrupt package installation (mysql)


Errors were encountered while processing: mysql-server-5.7 mysql-server16.04 upgrade broke mysql-serverWhat is the difference between dpkg and aptitude/apt-get?“sudo apt-get purge mysql” Failing on Ubuntu 16.04 LTSWhat to do with --force?Unable to install mysql 5.7 in ubuntu 5.7cannot upgrade kernel and mysql-server after dist upgradeCan not install MySQL on my Ubuntu 12.04Cannot install anything! Unmet dependencies. Libre OfficeProblem installing apache2MySql Installation problem in dual boot ubuntu 14.04mysql doesn't ask for root password when installingmysql-server-5.5 ErrorUnable to install MariaDB on circleCI ? Problems with dpkg.mysql-server-5.7 package post-installation script subprocess returned error exit status 127dpkg: error processing package sendmail-base






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









14















After upgrading to Ubuntu 16.04, I noticed mysql was having mind-boggling errors. Convinced, it was a broken setup, I tried running a purge of mysql. That didn't seem to delete everything, so I tried doing it myself:



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


This was a mistake. Don't EVER try to do this. Now mysql won't even install correctly. I've tried reinstalling the dependancies:



sudo apt-get install --reinstall $(apt-cache depends mysql-server | grep -Po 'Depends:s+K[^ ]+$' | tr 'n' ' ' )


And the packages themselves:



sudo apt install mysql-workbench mysql-server --reinstall


But I get all sorts of cryptic errors, such as:



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


And uninstalling



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.


Or if I reconfigure



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


Or if I Force install:



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)


Or if I do a purge:



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)


Is apt unable to recover from a partial install? Do I have to reinstall the OS??










share|improve this question


























  • have you tried to do a simpler approach, by sudo apt-get install --reinstall mysql ?

    – Videonauth
    May 16 '16 at 19:25











  • I updated to include the errors from those

    – Jonathan
    May 16 '16 at 20:08












  • Maybe you want to come into chat and we see if we can sort this out.

    – Videonauth
    May 16 '16 at 20:37

















14















After upgrading to Ubuntu 16.04, I noticed mysql was having mind-boggling errors. Convinced, it was a broken setup, I tried running a purge of mysql. That didn't seem to delete everything, so I tried doing it myself:



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


This was a mistake. Don't EVER try to do this. Now mysql won't even install correctly. I've tried reinstalling the dependancies:



sudo apt-get install --reinstall $(apt-cache depends mysql-server | grep -Po 'Depends:s+K[^ ]+$' | tr 'n' ' ' )


And the packages themselves:



sudo apt install mysql-workbench mysql-server --reinstall


But I get all sorts of cryptic errors, such as:



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


And uninstalling



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.


Or if I reconfigure



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


Or if I Force install:



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)


Or if I do a purge:



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)


Is apt unable to recover from a partial install? Do I have to reinstall the OS??










share|improve this question


























  • have you tried to do a simpler approach, by sudo apt-get install --reinstall mysql ?

    – Videonauth
    May 16 '16 at 19:25











  • I updated to include the errors from those

    – Jonathan
    May 16 '16 at 20:08












  • Maybe you want to come into chat and we see if we can sort this out.

    – Videonauth
    May 16 '16 at 20:37













14












14








14


6






After upgrading to Ubuntu 16.04, I noticed mysql was having mind-boggling errors. Convinced, it was a broken setup, I tried running a purge of mysql. That didn't seem to delete everything, so I tried doing it myself:



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


This was a mistake. Don't EVER try to do this. Now mysql won't even install correctly. I've tried reinstalling the dependancies:



sudo apt-get install --reinstall $(apt-cache depends mysql-server | grep -Po 'Depends:s+K[^ ]+$' | tr 'n' ' ' )


And the packages themselves:



sudo apt install mysql-workbench mysql-server --reinstall


But I get all sorts of cryptic errors, such as:



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


And uninstalling



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.


Or if I reconfigure



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


Or if I Force install:



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)


Or if I do a purge:



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)


Is apt unable to recover from a partial install? Do I have to reinstall the OS??










share|improve this question
















After upgrading to Ubuntu 16.04, I noticed mysql was having mind-boggling errors. Convinced, it was a broken setup, I tried running a purge of mysql. That didn't seem to delete everything, so I tried doing it myself:



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


This was a mistake. Don't EVER try to do this. Now mysql won't even install correctly. I've tried reinstalling the dependancies:



sudo apt-get install --reinstall $(apt-cache depends mysql-server | grep -Po 'Depends:s+K[^ ]+$' | tr 'n' ' ' )


And the packages themselves:



sudo apt install mysql-workbench mysql-server --reinstall


But I get all sorts of cryptic errors, such as:



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


And uninstalling



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.


Or if I reconfigure



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


Or if I Force install:



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)


Or if I do a purge:



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)


Is apt unable to recover from a partial install? Do I have to reinstall the OS??







apt package-management mysql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 30 '16 at 8:50







Jonathan

















asked May 16 '16 at 16:20









JonathanJonathan

1,7483 gold badges15 silver badges36 bronze badges




1,7483 gold badges15 silver badges36 bronze badges















  • have you tried to do a simpler approach, by sudo apt-get install --reinstall mysql ?

    – Videonauth
    May 16 '16 at 19:25











  • I updated to include the errors from those

    – Jonathan
    May 16 '16 at 20:08












  • Maybe you want to come into chat and we see if we can sort this out.

    – Videonauth
    May 16 '16 at 20:37

















  • have you tried to do a simpler approach, by sudo apt-get install --reinstall mysql ?

    – Videonauth
    May 16 '16 at 19:25











  • I updated to include the errors from those

    – Jonathan
    May 16 '16 at 20:08












  • Maybe you want to come into chat and we see if we can sort this out.

    – Videonauth
    May 16 '16 at 20:37
















have you tried to do a simpler approach, by sudo apt-get install --reinstall mysql ?

– Videonauth
May 16 '16 at 19:25





have you tried to do a simpler approach, by sudo apt-get install --reinstall mysql ?

– Videonauth
May 16 '16 at 19:25













I updated to include the errors from those

– Jonathan
May 16 '16 at 20:08






I updated to include the errors from those

– Jonathan
May 16 '16 at 20:08














Maybe you want to come into chat and we see if we can sort this out.

– Videonauth
May 16 '16 at 20:37





Maybe you want to come into chat and we see if we can sort this out.

– Videonauth
May 16 '16 at 20:37










7 Answers
7






active

oldest

votes


















21
















Do the following to clean out the broken packages:



sudo apt-get clean
sudo apt-get update
sudo dpkg -r mysql-client-5.7
sudo dpkg -r mysql-server-5.7
sudo dpkg -r libmysqlclient20:i386
sudo dpkg -r libmysqlclient20:amd64
sudo dpkg -r libmysqlclient18:amd64
sudo dpkg -r mysql-common
sudo dpkg -r mysql


After that reinstall it with:



sudo apt-get install mysql mysql-client* mysql-server*





share|improve this answer

























  • thanks a lot!! removing dependencies one by one is the only option to get out of apt-get stuck

    – stackMonk
    Nov 27 '17 at 13:23











  • +1 for this. Thanks for mentioning the complete stack of packages to be removed for MySQL to remove. It worked for me too.

    – Parveen Verma
    Jan 19 at 9:26











  • On my ubuntu 18.04 trying to remove mysqlclient ( running 3rd command) produced that : dependency problems prevent removal of mysql-client-5.7: mysql-server-5.7 depends on mysql-client-5.7 (>= 5.7.26-0ubuntu0.18.04.1). dpkg: error processing package mysql-client-5.7 (--remove): dependency problems - not removing Errors were encountered while processing: mysql-client-5.7, but running sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 as from here askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server seems that deleted the instance

    – Carmine
    May 30 at 21:55












  • now I got a bunch of error as I was trying to install sudo apt install openjdk-8-jre openjdk-8-jdk.

    – Carmine
    May 30 at 22:24











  • I was able to find the process that was previously blocking any of my attempt to clean the update of mysql, indeed I stopped an instance running in my system, then I purged as from the other solution linked. After that I made sure my system was update. Indeed I found out somehow I miss many update. After that now so far the installation of java sdk that require itself mysql instance seems proceeded well

    – Carmine
    May 31 at 6:22


















13
















Thanks to @Videonauth



sudo dpkg -r mysql-client-5.7
sudo dpkg -r mysql-server-5.7
sudo dpkg -r libmysqlclient20:i386
sudo dpkg -r libmysqlclient20:amd64
sudo dpkg -r libmysqlclient18:amd64
sudo dpkg -r mysql-common


Then running:



sudo apt-get purge mysql* mariadb* libmysql* libmariadb*


If anything fails, just run sudo dpkg -r <failedpackage> and if THAT fails just remove the package that is dependent on it. If you repeat, eventually apt-get will work again.



See also What is the difference between dpkg and aptitude/apt-get?






share|improve this answer



























  • Removing those libmysqlclient packages, even though other packages rely on them, and purging everything did the trick. Though now I get mysql_upgrade errors.

    – skerit
    May 26 '16 at 9:43











  • I never got mysql_upgrade errors. But you may have to remove even more packages. I suppose it depends on which package got corrupted. There's a way to search for all packages installed that are related to mysql but I forget how. I think it's a dpkg list command piped through grep

    – Jonathan
    May 30 '16 at 8:49


















8
















Try this,



run this command to purge mysql, replace version 5.7 with your installed version



sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server


run this to clean up and update packages



sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install


finally install mysql



sudo apt install mysql-server


this worked for me.






share|improve this answer






















  • 1





    This worked for me, where the selected answer did not (it failed on sudo dpkg -r mysql-client-5.7)

    – jeff-h
    May 3 '18 at 1:28











  • thank you! I was looking for a solution for hours and this is the only answer works!

    – mirza
    Nov 2 '18 at 22:01


















3
















After purging mysql as has been shown above, you have to install mysql this way:



sudo apt-get install mysql-common 
sudo apt-get install mysql-server


When you install this way you will not have an installation error.






share|improve this answer



























  • this works for me

    – user1735921
    Jun 13 '17 at 0:58


















1
















This worked for me



sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade


then after that I installed mysql again with



sudo apt-get install mysql-server
and now its working fine.






share|improve this answer
































    1
















    I don't know the exact reason, but all these methods did not work for me.
    In my case, the procedure that corrected the problem was:



    sudo apt-get purge mysql-*
    sudo apt-get autoremove
    sudo apt-get autoclean
    sudo apt-get dist-upgrade

    sudo rm -rf /etc/mysql
    sudo rm -rf /var/lib/mysql*


    and reboot!



    finally, I have been able to run
    sudo apt-get install mysql-server!






    share|improve this answer

























    • Thanks it worked for me

      – Nijo
      May 9 at 6:46


















    0
















    The command sudo dpkg -r does not work for me..



    I used sudo apt-get purge mysql-* to uninstall all the releated pageage
    and then reinstall them






    share|improve this answer


























      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/4.0/"u003ecc by-sa 4.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
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f773287%2fhow-to-repair-corrupt-package-installation-mysql%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









      21
















      Do the following to clean out the broken packages:



      sudo apt-get clean
      sudo apt-get update
      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common
      sudo dpkg -r mysql


      After that reinstall it with:



      sudo apt-get install mysql mysql-client* mysql-server*





      share|improve this answer

























      • thanks a lot!! removing dependencies one by one is the only option to get out of apt-get stuck

        – stackMonk
        Nov 27 '17 at 13:23











      • +1 for this. Thanks for mentioning the complete stack of packages to be removed for MySQL to remove. It worked for me too.

        – Parveen Verma
        Jan 19 at 9:26











      • On my ubuntu 18.04 trying to remove mysqlclient ( running 3rd command) produced that : dependency problems prevent removal of mysql-client-5.7: mysql-server-5.7 depends on mysql-client-5.7 (>= 5.7.26-0ubuntu0.18.04.1). dpkg: error processing package mysql-client-5.7 (--remove): dependency problems - not removing Errors were encountered while processing: mysql-client-5.7, but running sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 as from here askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server seems that deleted the instance

        – Carmine
        May 30 at 21:55












      • now I got a bunch of error as I was trying to install sudo apt install openjdk-8-jre openjdk-8-jdk.

        – Carmine
        May 30 at 22:24











      • I was able to find the process that was previously blocking any of my attempt to clean the update of mysql, indeed I stopped an instance running in my system, then I purged as from the other solution linked. After that I made sure my system was update. Indeed I found out somehow I miss many update. After that now so far the installation of java sdk that require itself mysql instance seems proceeded well

        – Carmine
        May 31 at 6:22















      21
















      Do the following to clean out the broken packages:



      sudo apt-get clean
      sudo apt-get update
      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common
      sudo dpkg -r mysql


      After that reinstall it with:



      sudo apt-get install mysql mysql-client* mysql-server*





      share|improve this answer

























      • thanks a lot!! removing dependencies one by one is the only option to get out of apt-get stuck

        – stackMonk
        Nov 27 '17 at 13:23











      • +1 for this. Thanks for mentioning the complete stack of packages to be removed for MySQL to remove. It worked for me too.

        – Parveen Verma
        Jan 19 at 9:26











      • On my ubuntu 18.04 trying to remove mysqlclient ( running 3rd command) produced that : dependency problems prevent removal of mysql-client-5.7: mysql-server-5.7 depends on mysql-client-5.7 (>= 5.7.26-0ubuntu0.18.04.1). dpkg: error processing package mysql-client-5.7 (--remove): dependency problems - not removing Errors were encountered while processing: mysql-client-5.7, but running sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 as from here askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server seems that deleted the instance

        – Carmine
        May 30 at 21:55












      • now I got a bunch of error as I was trying to install sudo apt install openjdk-8-jre openjdk-8-jdk.

        – Carmine
        May 30 at 22:24











      • I was able to find the process that was previously blocking any of my attempt to clean the update of mysql, indeed I stopped an instance running in my system, then I purged as from the other solution linked. After that I made sure my system was update. Indeed I found out somehow I miss many update. After that now so far the installation of java sdk that require itself mysql instance seems proceeded well

        – Carmine
        May 31 at 6:22













      21














      21










      21









      Do the following to clean out the broken packages:



      sudo apt-get clean
      sudo apt-get update
      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common
      sudo dpkg -r mysql


      After that reinstall it with:



      sudo apt-get install mysql mysql-client* mysql-server*





      share|improve this answer













      Do the following to clean out the broken packages:



      sudo apt-get clean
      sudo apt-get update
      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common
      sudo dpkg -r mysql


      After that reinstall it with:



      sudo apt-get install mysql mysql-client* mysql-server*






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered May 16 '16 at 23:26









      VideonauthVideonauth

      27k12 gold badges83 silver badges109 bronze badges




      27k12 gold badges83 silver badges109 bronze badges















      • thanks a lot!! removing dependencies one by one is the only option to get out of apt-get stuck

        – stackMonk
        Nov 27 '17 at 13:23











      • +1 for this. Thanks for mentioning the complete stack of packages to be removed for MySQL to remove. It worked for me too.

        – Parveen Verma
        Jan 19 at 9:26











      • On my ubuntu 18.04 trying to remove mysqlclient ( running 3rd command) produced that : dependency problems prevent removal of mysql-client-5.7: mysql-server-5.7 depends on mysql-client-5.7 (>= 5.7.26-0ubuntu0.18.04.1). dpkg: error processing package mysql-client-5.7 (--remove): dependency problems - not removing Errors were encountered while processing: mysql-client-5.7, but running sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 as from here askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server seems that deleted the instance

        – Carmine
        May 30 at 21:55












      • now I got a bunch of error as I was trying to install sudo apt install openjdk-8-jre openjdk-8-jdk.

        – Carmine
        May 30 at 22:24











      • I was able to find the process that was previously blocking any of my attempt to clean the update of mysql, indeed I stopped an instance running in my system, then I purged as from the other solution linked. After that I made sure my system was update. Indeed I found out somehow I miss many update. After that now so far the installation of java sdk that require itself mysql instance seems proceeded well

        – Carmine
        May 31 at 6:22

















      • thanks a lot!! removing dependencies one by one is the only option to get out of apt-get stuck

        – stackMonk
        Nov 27 '17 at 13:23











      • +1 for this. Thanks for mentioning the complete stack of packages to be removed for MySQL to remove. It worked for me too.

        – Parveen Verma
        Jan 19 at 9:26











      • On my ubuntu 18.04 trying to remove mysqlclient ( running 3rd command) produced that : dependency problems prevent removal of mysql-client-5.7: mysql-server-5.7 depends on mysql-client-5.7 (>= 5.7.26-0ubuntu0.18.04.1). dpkg: error processing package mysql-client-5.7 (--remove): dependency problems - not removing Errors were encountered while processing: mysql-client-5.7, but running sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 as from here askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server seems that deleted the instance

        – Carmine
        May 30 at 21:55












      • now I got a bunch of error as I was trying to install sudo apt install openjdk-8-jre openjdk-8-jdk.

        – Carmine
        May 30 at 22:24











      • I was able to find the process that was previously blocking any of my attempt to clean the update of mysql, indeed I stopped an instance running in my system, then I purged as from the other solution linked. After that I made sure my system was update. Indeed I found out somehow I miss many update. After that now so far the installation of java sdk that require itself mysql instance seems proceeded well

        – Carmine
        May 31 at 6:22
















      thanks a lot!! removing dependencies one by one is the only option to get out of apt-get stuck

      – stackMonk
      Nov 27 '17 at 13:23





      thanks a lot!! removing dependencies one by one is the only option to get out of apt-get stuck

      – stackMonk
      Nov 27 '17 at 13:23













      +1 for this. Thanks for mentioning the complete stack of packages to be removed for MySQL to remove. It worked for me too.

      – Parveen Verma
      Jan 19 at 9:26





      +1 for this. Thanks for mentioning the complete stack of packages to be removed for MySQL to remove. It worked for me too.

      – Parveen Verma
      Jan 19 at 9:26













      On my ubuntu 18.04 trying to remove mysqlclient ( running 3rd command) produced that : dependency problems prevent removal of mysql-client-5.7: mysql-server-5.7 depends on mysql-client-5.7 (>= 5.7.26-0ubuntu0.18.04.1). dpkg: error processing package mysql-client-5.7 (--remove): dependency problems - not removing Errors were encountered while processing: mysql-client-5.7, but running sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 as from here askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server seems that deleted the instance

      – Carmine
      May 30 at 21:55






      On my ubuntu 18.04 trying to remove mysqlclient ( running 3rd command) produced that : dependency problems prevent removal of mysql-client-5.7: mysql-server-5.7 depends on mysql-client-5.7 (>= 5.7.26-0ubuntu0.18.04.1). dpkg: error processing package mysql-client-5.7 (--remove): dependency problems - not removing Errors were encountered while processing: mysql-client-5.7, but running sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 as from here askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server seems that deleted the instance

      – Carmine
      May 30 at 21:55














      now I got a bunch of error as I was trying to install sudo apt install openjdk-8-jre openjdk-8-jdk.

      – Carmine
      May 30 at 22:24





      now I got a bunch of error as I was trying to install sudo apt install openjdk-8-jre openjdk-8-jdk.

      – Carmine
      May 30 at 22:24













      I was able to find the process that was previously blocking any of my attempt to clean the update of mysql, indeed I stopped an instance running in my system, then I purged as from the other solution linked. After that I made sure my system was update. Indeed I found out somehow I miss many update. After that now so far the installation of java sdk that require itself mysql instance seems proceeded well

      – Carmine
      May 31 at 6:22





      I was able to find the process that was previously blocking any of my attempt to clean the update of mysql, indeed I stopped an instance running in my system, then I purged as from the other solution linked. After that I made sure my system was update. Indeed I found out somehow I miss many update. After that now so far the installation of java sdk that require itself mysql instance seems proceeded well

      – Carmine
      May 31 at 6:22













      13
















      Thanks to @Videonauth



      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common


      Then running:



      sudo apt-get purge mysql* mariadb* libmysql* libmariadb*


      If anything fails, just run sudo dpkg -r <failedpackage> and if THAT fails just remove the package that is dependent on it. If you repeat, eventually apt-get will work again.



      See also What is the difference between dpkg and aptitude/apt-get?






      share|improve this answer



























      • Removing those libmysqlclient packages, even though other packages rely on them, and purging everything did the trick. Though now I get mysql_upgrade errors.

        – skerit
        May 26 '16 at 9:43











      • I never got mysql_upgrade errors. But you may have to remove even more packages. I suppose it depends on which package got corrupted. There's a way to search for all packages installed that are related to mysql but I forget how. I think it's a dpkg list command piped through grep

        – Jonathan
        May 30 '16 at 8:49















      13
















      Thanks to @Videonauth



      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common


      Then running:



      sudo apt-get purge mysql* mariadb* libmysql* libmariadb*


      If anything fails, just run sudo dpkg -r <failedpackage> and if THAT fails just remove the package that is dependent on it. If you repeat, eventually apt-get will work again.



      See also What is the difference between dpkg and aptitude/apt-get?






      share|improve this answer



























      • Removing those libmysqlclient packages, even though other packages rely on them, and purging everything did the trick. Though now I get mysql_upgrade errors.

        – skerit
        May 26 '16 at 9:43











      • I never got mysql_upgrade errors. But you may have to remove even more packages. I suppose it depends on which package got corrupted. There's a way to search for all packages installed that are related to mysql but I forget how. I think it's a dpkg list command piped through grep

        – Jonathan
        May 30 '16 at 8:49













      13














      13










      13









      Thanks to @Videonauth



      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common


      Then running:



      sudo apt-get purge mysql* mariadb* libmysql* libmariadb*


      If anything fails, just run sudo dpkg -r <failedpackage> and if THAT fails just remove the package that is dependent on it. If you repeat, eventually apt-get will work again.



      See also What is the difference between dpkg and aptitude/apt-get?






      share|improve this answer















      Thanks to @Videonauth



      sudo dpkg -r mysql-client-5.7
      sudo dpkg -r mysql-server-5.7
      sudo dpkg -r libmysqlclient20:i386
      sudo dpkg -r libmysqlclient20:amd64
      sudo dpkg -r libmysqlclient18:amd64
      sudo dpkg -r mysql-common


      Then running:



      sudo apt-get purge mysql* mariadb* libmysql* libmariadb*


      If anything fails, just run sudo dpkg -r <failedpackage> and if THAT fails just remove the package that is dependent on it. If you repeat, eventually apt-get will work again.



      See also What is the difference between dpkg and aptitude/apt-get?







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jun 21 '17 at 0:00

























      answered May 16 '16 at 23:22









      JonathanJonathan

      1,7483 gold badges15 silver badges36 bronze badges




      1,7483 gold badges15 silver badges36 bronze badges















      • Removing those libmysqlclient packages, even though other packages rely on them, and purging everything did the trick. Though now I get mysql_upgrade errors.

        – skerit
        May 26 '16 at 9:43











      • I never got mysql_upgrade errors. But you may have to remove even more packages. I suppose it depends on which package got corrupted. There's a way to search for all packages installed that are related to mysql but I forget how. I think it's a dpkg list command piped through grep

        – Jonathan
        May 30 '16 at 8:49

















      • Removing those libmysqlclient packages, even though other packages rely on them, and purging everything did the trick. Though now I get mysql_upgrade errors.

        – skerit
        May 26 '16 at 9:43











      • I never got mysql_upgrade errors. But you may have to remove even more packages. I suppose it depends on which package got corrupted. There's a way to search for all packages installed that are related to mysql but I forget how. I think it's a dpkg list command piped through grep

        – Jonathan
        May 30 '16 at 8:49
















      Removing those libmysqlclient packages, even though other packages rely on them, and purging everything did the trick. Though now I get mysql_upgrade errors.

      – skerit
      May 26 '16 at 9:43





      Removing those libmysqlclient packages, even though other packages rely on them, and purging everything did the trick. Though now I get mysql_upgrade errors.

      – skerit
      May 26 '16 at 9:43













      I never got mysql_upgrade errors. But you may have to remove even more packages. I suppose it depends on which package got corrupted. There's a way to search for all packages installed that are related to mysql but I forget how. I think it's a dpkg list command piped through grep

      – Jonathan
      May 30 '16 at 8:49





      I never got mysql_upgrade errors. But you may have to remove even more packages. I suppose it depends on which package got corrupted. There's a way to search for all packages installed that are related to mysql but I forget how. I think it's a dpkg list command piped through grep

      – Jonathan
      May 30 '16 at 8:49











      8
















      Try this,



      run this command to purge mysql, replace version 5.7 with your installed version



      sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server


      run this to clean up and update packages



      sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install


      finally install mysql



      sudo apt install mysql-server


      this worked for me.






      share|improve this answer






















      • 1





        This worked for me, where the selected answer did not (it failed on sudo dpkg -r mysql-client-5.7)

        – jeff-h
        May 3 '18 at 1:28











      • thank you! I was looking for a solution for hours and this is the only answer works!

        – mirza
        Nov 2 '18 at 22:01















      8
















      Try this,



      run this command to purge mysql, replace version 5.7 with your installed version



      sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server


      run this to clean up and update packages



      sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install


      finally install mysql



      sudo apt install mysql-server


      this worked for me.






      share|improve this answer






















      • 1





        This worked for me, where the selected answer did not (it failed on sudo dpkg -r mysql-client-5.7)

        – jeff-h
        May 3 '18 at 1:28











      • thank you! I was looking for a solution for hours and this is the only answer works!

        – mirza
        Nov 2 '18 at 22:01













      8














      8










      8









      Try this,



      run this command to purge mysql, replace version 5.7 with your installed version



      sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server


      run this to clean up and update packages



      sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install


      finally install mysql



      sudo apt install mysql-server


      this worked for me.






      share|improve this answer















      Try this,



      run this command to purge mysql, replace version 5.7 with your installed version



      sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server


      run this to clean up and update packages



      sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install


      finally install mysql



      sudo apt install mysql-server


      this worked for me.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Feb 16 '18 at 7:49

























      answered Jul 9 '17 at 19:16









      rahulrahul

      1831 silver badge5 bronze badges




      1831 silver badge5 bronze badges










      • 1





        This worked for me, where the selected answer did not (it failed on sudo dpkg -r mysql-client-5.7)

        – jeff-h
        May 3 '18 at 1:28











      • thank you! I was looking for a solution for hours and this is the only answer works!

        – mirza
        Nov 2 '18 at 22:01












      • 1





        This worked for me, where the selected answer did not (it failed on sudo dpkg -r mysql-client-5.7)

        – jeff-h
        May 3 '18 at 1:28











      • thank you! I was looking for a solution for hours and this is the only answer works!

        – mirza
        Nov 2 '18 at 22:01







      1




      1





      This worked for me, where the selected answer did not (it failed on sudo dpkg -r mysql-client-5.7)

      – jeff-h
      May 3 '18 at 1:28





      This worked for me, where the selected answer did not (it failed on sudo dpkg -r mysql-client-5.7)

      – jeff-h
      May 3 '18 at 1:28













      thank you! I was looking for a solution for hours and this is the only answer works!

      – mirza
      Nov 2 '18 at 22:01





      thank you! I was looking for a solution for hours and this is the only answer works!

      – mirza
      Nov 2 '18 at 22:01











      3
















      After purging mysql as has been shown above, you have to install mysql this way:



      sudo apt-get install mysql-common 
      sudo apt-get install mysql-server


      When you install this way you will not have an installation error.






      share|improve this answer



























      • this works for me

        – user1735921
        Jun 13 '17 at 0:58















      3
















      After purging mysql as has been shown above, you have to install mysql this way:



      sudo apt-get install mysql-common 
      sudo apt-get install mysql-server


      When you install this way you will not have an installation error.






      share|improve this answer



























      • this works for me

        – user1735921
        Jun 13 '17 at 0:58













      3














      3










      3









      After purging mysql as has been shown above, you have to install mysql this way:



      sudo apt-get install mysql-common 
      sudo apt-get install mysql-server


      When you install this way you will not have an installation error.






      share|improve this answer















      After purging mysql as has been shown above, you have to install mysql this way:



      sudo apt-get install mysql-common 
      sudo apt-get install mysql-server


      When you install this way you will not have an installation error.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 28 '17 at 9:26









      d a i s y

      3,6568 gold badges27 silver badges48 bronze badges




      3,6568 gold badges27 silver badges48 bronze badges










      answered Apr 28 '17 at 9:18









      tomektomek

      311 bronze badge




      311 bronze badge















      • this works for me

        – user1735921
        Jun 13 '17 at 0:58

















      • this works for me

        – user1735921
        Jun 13 '17 at 0:58
















      this works for me

      – user1735921
      Jun 13 '17 at 0:58





      this works for me

      – user1735921
      Jun 13 '17 at 0:58











      1
















      This worked for me



      sudo apt-get purge mysql*
      sudo apt-get autoremove
      sudo apt-get autoclean
      sudo apt-get dist-upgrade


      then after that I installed mysql again with



      sudo apt-get install mysql-server
      and now its working fine.






      share|improve this answer





























        1
















        This worked for me



        sudo apt-get purge mysql*
        sudo apt-get autoremove
        sudo apt-get autoclean
        sudo apt-get dist-upgrade


        then after that I installed mysql again with



        sudo apt-get install mysql-server
        and now its working fine.






        share|improve this answer



























          1














          1










          1









          This worked for me



          sudo apt-get purge mysql*
          sudo apt-get autoremove
          sudo apt-get autoclean
          sudo apt-get dist-upgrade


          then after that I installed mysql again with



          sudo apt-get install mysql-server
          and now its working fine.






          share|improve this answer













          This worked for me



          sudo apt-get purge mysql*
          sudo apt-get autoremove
          sudo apt-get autoclean
          sudo apt-get dist-upgrade


          then after that I installed mysql again with



          sudo apt-get install mysql-server
          and now its working fine.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 13 '17 at 5:47









          Jayakrishnan MenonJayakrishnan Menon

          18910 bronze badges




          18910 bronze badges
























              1
















              I don't know the exact reason, but all these methods did not work for me.
              In my case, the procedure that corrected the problem was:



              sudo apt-get purge mysql-*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get dist-upgrade

              sudo rm -rf /etc/mysql
              sudo rm -rf /var/lib/mysql*


              and reboot!



              finally, I have been able to run
              sudo apt-get install mysql-server!






              share|improve this answer

























              • Thanks it worked for me

                – Nijo
                May 9 at 6:46















              1
















              I don't know the exact reason, but all these methods did not work for me.
              In my case, the procedure that corrected the problem was:



              sudo apt-get purge mysql-*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get dist-upgrade

              sudo rm -rf /etc/mysql
              sudo rm -rf /var/lib/mysql*


              and reboot!



              finally, I have been able to run
              sudo apt-get install mysql-server!






              share|improve this answer

























              • Thanks it worked for me

                – Nijo
                May 9 at 6:46













              1














              1










              1









              I don't know the exact reason, but all these methods did not work for me.
              In my case, the procedure that corrected the problem was:



              sudo apt-get purge mysql-*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get dist-upgrade

              sudo rm -rf /etc/mysql
              sudo rm -rf /var/lib/mysql*


              and reboot!



              finally, I have been able to run
              sudo apt-get install mysql-server!






              share|improve this answer













              I don't know the exact reason, but all these methods did not work for me.
              In my case, the procedure that corrected the problem was:



              sudo apt-get purge mysql-*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get dist-upgrade

              sudo rm -rf /etc/mysql
              sudo rm -rf /var/lib/mysql*


              and reboot!



              finally, I have been able to run
              sudo apt-get install mysql-server!







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 17 at 13:24









              s1l3n0s1l3n0

              1111 bronze badge




              1111 bronze badge















              • Thanks it worked for me

                – Nijo
                May 9 at 6:46

















              • Thanks it worked for me

                – Nijo
                May 9 at 6:46
















              Thanks it worked for me

              – Nijo
              May 9 at 6:46





              Thanks it worked for me

              – Nijo
              May 9 at 6:46











              0
















              The command sudo dpkg -r does not work for me..



              I used sudo apt-get purge mysql-* to uninstall all the releated pageage
              and then reinstall them






              share|improve this answer





























                0
















                The command sudo dpkg -r does not work for me..



                I used sudo apt-get purge mysql-* to uninstall all the releated pageage
                and then reinstall them






                share|improve this answer



























                  0














                  0










                  0









                  The command sudo dpkg -r does not work for me..



                  I used sudo apt-get purge mysql-* to uninstall all the releated pageage
                  and then reinstall them






                  share|improve this answer













                  The command sudo dpkg -r does not work for me..



                  I used sudo apt-get purge mysql-* to uninstall all the releated pageage
                  and then reinstall them







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 19 '18 at 17:41









                  Ruijie YuanRuijie Yuan

                  1




                  1































                      draft saved

                      draft discarded















































                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f773287%2fhow-to-repair-corrupt-package-installation-mysql%23new-answer', 'question_page');

                      );

                      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







                      Popular posts from this blog

                      Tamil (spriik) Luke uk diar | Nawigatjuun

                      Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                      Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?