0

---I have already tried (twice)--- Install of mysql-server after mariadb fails mariadb is not the issue because although it was installed on this computer, all dependencies have already been removed, as shown here. the terminal capture is as follows https://pastebin.ubuntu.com/p/9pPQDbFzYf/ circumstances may be similar but the situation is not.

I have removed Libmysqlclient21 in synaptic since it appeared as broken, attempted to uninstall MySQL successfully on synaptic and reinstall it synaptic UNsuccessfully, apparently there is a running MySQL process that I can't find, which prevents the installation of mysql-server-8.0 (mysql-client, client-8.0, client-core-8.0, server and server-core-8.0 reinstall just fine). Following you will find the ubuntu terminal capture cleaning up https://pastebin.ubuntu.com/p/pJCxYm5K2w/ , as well as synaptic screen capture displaying a conflict with "itself", ps aux reports no instance of mysql running,

mysql server conflict

Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 220062 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.5ubuntu2_all.deb ...
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
Selecting previously unselected package mysql-client-core-8.0.
Preparing to unpack .../mysql-client-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-client-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../mysql-server-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-common (5.8+1.0.5ubuntu2) ...
update-alternatives: warning: alternative /etc/mysql/mysql.cnf (part of link group my.cnf) doesn't exist; removing from list of alternatives
update-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choice
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-8.0.
(Reading database ... 220262 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.20-0ubuntu0.20.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-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb (--unpack):
 new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

output from reinstalling on synaptic

Preconfiguring packages ...
(Reading database ... 221833 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.20-0ubuntu0.20.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-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb (--unpack):
 new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not installed.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server

second Reinstall atempt

Preconfiguring packages ...  
Selecting previously unselected package mysql-common.  
(Reading database ... 220062 files and directories currently installed.) 
Preparing to unpack .../mysql-common_5.8+1.0.5ubuntu2_all.deb ... 
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...  
Selecting previously unselected package mysql-client-core-8.0.  
Preparing to unpack .../mysql-client-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...  
Unpacking mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...  
Selecting previously unselected package mysql-client-8.0.  
Preparing to unpack .../mysql-client-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...  
Unpacking mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...  
Selecting previously unselected package mysql-server-core-8.0.  
Preparing to unpack .../mysql-server-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...  
Unpacking mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...  
Setting up mysql-common (5.8+1.0.5ubuntu2) ...  
update-alternatives: warning: alternative /etc/mysql/mysql.cnf (part of link group my.cnf) doesn't exist;   
  removing from list of alternatives
update-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choice  
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode  
Selecting previously unselected package mysql-server-8.0.  
(Reading database ... 220262 files and directories currently installed.)  
Preparing to unpack .../mysql-server-8.0_8.0.20-0ubuntu0.20.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-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb (--unpack):  
 new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1  
Errors were encountered while processing:  
 /var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb  
E: Sub-process /usr/bin/dpkg returned an error code (1)  
A package failed to install.  Trying to recover:  
Setting up mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...  
Setting up mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...  
Setting up mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...  
Processing triggers for man-db (2.9.1-1) ...  
Processing triggers for libc-bin (2.31-0ubuntu9) ...  

ps aux command output, no running process related to MySQL (that I know of) https://pastebin.ubuntu.com/p/z4cCYXBykW/

Thank you a lot

Mario
  • 81
  • 1
  • 10

1 Answers1

4

Just in case someone gets in the same situation, this is something to consider. I don't understand what happened, I was accessing the ubuntu machine remotely through a user account with full administrative privileges, but it was not the account created at the time of installing ubuntu, now I have finally accessed the computer directly and login in with the original account and much to my surprise, when I attempted to uninstall all of MySQL trough synaptic, I didn't get warnings or errors at all, just to play it on the safe side I run the following commands

# sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
# sudo apt-get autoremove -y
# rm -rf /etc/mysql
# sudo find / -iname 'mysql*' -exec rm -rf {} \;
# apt --fix-broken install

no errors or warnings at all, so I launched synaptic and reinstalled mysql-server (synaptic took care of the dependencies) and the installation finished correctly. This makes no sense to me since a user account with full administrative privileges should have full access, but there yo have it, MySQL is installed and running.

Mario
  • 81
  • 1
  • 10