0

using the following command

1.sudo apt update
2.sudo apt install mysql-server

Getting below error

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Any help ?

  • 1
    Remove whatever non-Ubuntu repository you added. Uninstall ALL packages that you successfully installed from that repository. Then run `sudo apt update` to refresh you database of available packages. Then install `mysql-server` from the Ubuntu repositories. – user535733 Mar 04 '21 at 19:54
  • We don't know your release, nor what 3rd party sources (if any) you've added so cannot check if they're appropriate for your system (they will create *dep* issues if they aren't), so user535733's comment is the best we can do thus far – guiverc Mar 04 '21 at 21:48
  • 2
    Does this answer your question? [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages) – Artur Meinild Aug 22 '22 at 06:29

1 Answers1

0

my friend. It seems you have a bug with repositories.

So first, remove all non-official repositories from the distribution. Or third-party repositories.

Then, run

sudo apt update

Then you can install MySQL 8 by adding the official repository

wget https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb

Refresh APT again

sudo apt update

And perform the MySQL installation

sudo apt install mysql-server 

And also you can install the client.

Here is the reference.It should be enough.

  • Reading package lists... Error! E: flAbsPath on /var/lib/dpkg/status failed - realpath (2: No such file or directory) E: Could not open file - open (2: No such file or directory) E: Problem opening E: The package lists or status file could not be parsed or opened. – MANISH KANVADIYA Mar 05 '21 at 09:33
  • getting above error while using sudo apt update – MANISH KANVADIYA Mar 05 '21 at 09:34
  • So first, remove all non-official repositories from the distribution. Or third-party repositories. how to remove that sorry but i am new in that – MANISH KANVADIYA Mar 05 '21 at 09:35