0

So, ive installed MySQL but in the middle my PC Decided to crash and the Linux Terminal died therefore cancelling the operation... Now when i try to install it i get this

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-8.0 (8.0.25-0ubuntu0.20.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

Ive tried doing some steps like

1st Try:
sudo apt-get clean
sudo apt-get purge mysql*
sudo apt-get update
sudo apt-get install -f
sudo apt-get install mysql-server-5.7
sudo apt-get dist-upgrade

2nd Try:
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade

But still cannot get working no matter what i try, if anybody could help me or point me in the right direction would be a massive help... Ive been trying to fix this for now 2 hours and really out of ideas...

Edit: Also, i cannot upgrade the server using sudo apt-get upgrade as i get the same error

root@hs1:~# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-server-8.0 (8.0.25-0ubuntu0.20.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

1 Answers1

1

To reinstall a package you can use

sudo apt-get install mysql-server-5.7 --reinstall

if there is some issues with reconfiguring the package you can use

sudo dpkg-reconfigure mysql-server-5.7

And also check for error logs at var/log/mysql for logs files which may contain clues as to why mysql is not working

Nimal V
  • 17
  • 3