unable to install mysql on ubuntu 16.04

不想你离开。 提交于 2020-05-13 18:16:43

问题


I ran the following command

wget http://repo.mysql.com/mysql-apt-config_0.8.9-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.9-1_all.deb
sudo apt-get update

all goes well but when i hit

sudo apt-get install mysql-server

It gives me following errors

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-community-server (= 5.7.20-1ubuntu16.04) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

To fix broken packages i did ran

sudo apt-get install -f
sudo apt autoremove 
sudo apt-get update

but all in vain. Thanks to you guys in advance :)


回答1:


try to install mysql server with the version.

sudo apt-get update
sudo apt-get install mysql-server-5.6



回答2:


To begin with, I deleted MySQL with:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

Then I downloaded the .deb from oficial page and used the following commands:

curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
sudo dpkg -i mysql-apt-config*
sudo apt update
sudo apt install mysql-server -y

At this point I had trouble because of Ubuntu eoan "incompability" (I'm using Ubuntu 19.10), displaying a message like: "The detected system (Debian jessie) is not supported by MySQL. If you believe the platform is compatible with one of the supported systems, one of the corresponding repositories may be selected". But I researched in MySQL bugs page and ran:

dpkg -i mysql-apt-config_0.8.13-1_all.deb 
sudo apt update
sudo apt install mysql-server -y

When it finishes, you may check the installation with:

sudo systemctl status mysql.service

And you should see something like...

This worked for me, after trying solutions in StackExchange, none of which worked. I hope this helps! Looking for feedback if I did something wrong, thanks.



来源:https://stackoverflow.com/questions/48012246/unable-to-install-mysql-on-ubuntu-16-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!