Using Kubuntu 17.04. I tried to install mariadb, which did not work, so now I am trying to revert back to mysql. However when I try to install mysql it is not working anymore either:
~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.19-0ubuntu0.17.04.1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
So then I tried the suggest --fix-broken:
~# apt-get --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-server-5.7
Suggested packages:
tinyca
The following NEW packages will be installed
mysql-server-5.7
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
5 not fully installed or removed.
Need to get 3,363 kB of archives.
After this operation, 50.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://gb.archive.ubuntu.com/ubuntu zesty-updates/main amd64 mysql-server-5.7 amd64 5.7.19-0ubuntu0.17.04.1 [3,363 kB]
Fetched 3,363 kB in 1s (3,049 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 304498 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Am a little stuck now. Can anyone help me getting my system stable again?
Update: tried to run the suggested commands, but that did not solve the problem:
~$ sudo service mysql stop
Failed to stop mysql.service: Unit mysql.service not loaded.
~$ sudo apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-server-5.7
Suggested packages:
tinyca
The following NEW packages will be installed
mysql-server-5.7
0 to upgrade, 1 to newly install, 0 to remove and 5 not to upgrade.
5 not fully installed or removed.
Need to get 0 B/3,363 kB of archives.
After this operation, 50.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
(Reading database ... 304498 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
~$ sudo pkill mysqld
~$ sudo killall mysqld
mysqld: no process found
~$ sudo apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-server-5.7
Suggested packages:
tinyca
The following NEW packages will be installed
mysql-server-5.7
0 to upgrade, 1 to newly install, 0 to remove and 5 not to upgrade.
5 not fully installed or removed.
Need to get 0 B/3,363 kB of archives.
After this operation, 50.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
(Reading database ... 304498 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.19-0ubuntu0.17.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo systemctl stop mysql
to stop it.