The package mysql-server-5.7 needs to be reinstalled, but I can't find an archive for it

Issue

My MySql is not working. When I want to reinstall MySql on linux server the I it shows following message.

sudo apt install mysql-server mysql-client --fix-broken 

message:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package mysql-server-5.7 needs to be reinstalled, but I can't find an archive for it.

Solution

Try sudo dpkg --remove --force-all mysql-server-5.7

If that doesn’t work,

sudo vim /var/lib/dpkg/status

You can do this with any text editor.

After you open that find the section about mysql-server-5.7. Delete the section with the information pertaining to it and save the file. Make sure you do a backup of the status file before you do this.

Reinstall your package using apt-get install

Answered By – BinaryGandalf

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published