Ubuntu: Cannot uninstall and reinstall mySQL [closed]



Question:

I somehow just lost the ability to connect to my local MySQl server (Linux Mint 17.3) so I found instructions to uninstall and then reinstall MySQL, however this does not seem to be working. I have tried multiple different console commands to do this but no luck so far, an example of the commands I am using is:

sudo mysqld stop  sudo apt-get remove --purge mysql-server mysql-client mysql-common  sudo apt-get autoremove  sudo apt-get autoclean  sudo apt-get install mysql-server  

The result is:

start: Job failed to start  invoke-rc.d: initscript mysql, action "start" failed.  dpkg: error processing package mysql-server-5.6 (--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.6; however:    Package mysql-server-5.6 is not configured yet.    dpkg: error processing package mysql-server (--configure):   dependency problems - leaving unconfigured  Processing triggers for libc-bin (2.19-0ubuntu6.9) ...  Processing triggers for ureadahead (0.100.0-16) ...  Errors were encountered while processing:   mysql-server-5.6   mysql-server  E: Sub-process /usr/bin/dpkg returned an error code (1)  

Funnily enough job failed to start error was the error I was getting before all this happened. The only thing I did before this all started happening was install cakephp so I am really confused as to how this can start happening out of the blue.

EDIT the error I am now getting is:

start: Job failed to start  invoke-rc.d: initscript mysql, action "start" failed.  dpkg: error processing package mysql-server-5.6 (--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.6; however:    Package mysql-server-5.6 is not configured yet.    dpkg: error processing package mysql-server (--configure):   dependency problems - leaving unconfigured  Errors were encountered while processing:   mysql-server-5.6   mysql-server  E: Sub-process /usr/bin/dpkg returned an error code (1)  

EDIT 2:

Got the error pupup: you have one broken package on your system use the broken filter to locate it

so tried the following:

Go into Synaptic and drop down the Edit menu and click "Fix Broken Packages", then click apply. Most of the time broken packages are those with missing dependencies.

and got the error message:

E: /var/cache/apt/archives/mysql-server-5.5_5.5.52-0ubuntu0.14.04.1_amd64.deb: subprocess new pre-installation script returned error exit status 1  

Edit 3: I performed a blank install of lamp on a virtual machine, following the instructions from here: http://tecadmin.net/install-php-7-0-apache-2-4-mysql-5-6-on-ubuntu/

and the error crops up here as well!

Edit 4: I have tried Minigeek's suggestion, but the terminal comes up with errors again:

sudo software-properties-gtk   Error: Can't find the age of https://mirrors.c0urier.net/?dir=linux/linuxmint/packages/db/version !!  /usr/lib/linuxmint/mintSources/mintSources.py:499: GtkWarning: IA__gtk_list_store_set_value: assertion 'VALID_ITER (iter, list_store)' failed    model.set_value(iter, MirrorSelectionDialog.MIRROR_SPEED_COLUMN, download_speed)  /usr/lib/linuxmint/mintSources/mintSources.py:500: GtkWarning: IA__gtk_list_store_set_value: assertion 'VALID_ITER (iter, list_store)' failed    model.set_value(iter, MirrorSelectionDialog.MIRROR_SPEED_LABEL_COLUMN, self._get_speed_label(download_speed))  /usr/lib/linuxmint/mintSources/mintSources.py:443: GtkWarning: gtk_list_store_get_value: assertion 'VALID_ITER (iter, list_store)' failed    mirror = self._mirrors_model.get_value(iter, MirrorSelectionDialog.MIRROR_COLUMN)  Unhandled exception in thread started by <bound method MirrorSelectionDialog._all_speed_tests of <__main__.MirrorSelectionDialog object at 0x7f19ee330850>>  Traceback (most recent call last):    File "/usr/lib/linuxmint/mintSources/mintSources.py", line 443, in _all_speed_tests      mirror = self._mirrors_model.get_value(iter, MirrorSelectionDialog.MIRROR_COLUMN)  TypeError: unknown type (null)  Error '(28, 'Connection timed out after 5000 milliseconds')' on url http://mirror.krystal.co.uk/ubuntu  /usr/lib/linuxmint/mintSources/mintSources.py:497: GtkWarning: IA__gtk_list_store_remove: assertion 'VALID_ITER (iter, list_store)' failed    model.remove(iter)  Unhandled exception in thread started by <bound method MirrorSelectionDialog._all_speed_tests of <__main__.MirrorSelectionDialog object at 0x7f19ee330850>>  Traceback (most recent call last):    File "/usr/lib/linuxmint/mintSources/mintSources.py", line 443, in _all_speed_tests      mirror = self._mirrors_model.get_value(iter, MirrorSelectionDialog.MIRROR_COLUMN)  TypeError: unknown type (null)    (synaptic:6925): Gtk-CRITICAL **: gtk_widget_hide: assertion 'GTK_IS_WIDGET (widget)' failed  


Solution:1

 sudo apt-get autoclean  

remove sources.list file.and create new sources.list...

sudo rm /etc/apt/sources.list   

Then, type in

sudo software-properties-gtk   

enter image description here This will open software-properties-gtk and a newsources.list will be created automatically.

Then change the server to US or to any other server of your choice. You must enable repositories from the new dialog in order to create new sources.list.

Tick all the boxes then click on Revert then click close.

Need to restore default repositories

 sudo apt-get update && sudo apt-get dist-upgrade -y  

(it is good practice to backup this file before installing to recover if such things happen)

Now install anything! sudo apt-get install mysql-server


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »