1

Im trying to purge mysql and reinstall it using this command 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 and this is what i get

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mysql-client-5.7' is not installed, so not removed
Package 'mysql-server' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libaio1 libevent-core-2.1-6
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  mysql-client-core-5.7* mysql-common* mysql-server-5.7* mysql-server-core-5.7*
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 126 MB disk space will be freed.
Do you want to continue? [Y/n] y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 177854 files and directories currently installed.)
Removing mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package mysql-server-5.7 (--remove):
 installed mysql-server-5.7 package pre-removal script subprocess returned error exit status 1
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error while cleaning up:
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
Removing mysql-client-core-5.7 (5.7.25-0ubuntu0.18.04.2) ...
dpkg: mysql-server-core-5.7: dependency problems, but removing anyway as you requested:
 mysql-server-5.7 depends on mysql-server-core-5.7 (= 5.7.25-0ubuntu0.18.04.2); however:
  Package mysql-server-core-5.7 is to be removed.

Removing mysql-server-core-5.7 (5.7.25-0ubuntu0.18.04.2) ...
Errors were encountered while processing:
 mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

then i notice this line

Errors were encountered while processing:
 mysql-server-5.7

My question is, How can i completely remove mysql and reinstall it again? My thought maybe because mysql-server-5.7 cannot be deleted by purge, thats why i get this result

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not going to be installed
                    Depends: mysql-client-5.7 (>= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
                    Depends: mysql-common (>= 5.8+1.0.4~) but it is not going to be installed
                    Depends: mysql-server-core-5.7 (= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

by running this sudo apt install mysql-server command.

Lesther
  • 113
  • 2

1 Answers1

0

It tells you what to do (although you need to be a bit experienced to know that):

The following packages have unmet dependencies:
 mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not going to be installed
                    Depends: mysql-client-5.7 (>= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
                    Depends: mysql-common (>= 5.8+1.0.4~) but it is not going to be installed
                    Depends: mysql-server-core-5.7 (= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Thus, I'd try and purge everything except mysql-server-5.7 and then in a separate step purge mysql-server-5.7.

RonJohn
  • 679