Ubuntu 18.04 LTS: Problem with dependencies installing MySQL 8.0 server

This fixed it for me (MySQL 8.0 - Ubuntu 20.04)

sudo apt-get purge mysql\* libmysql\*
sudo apt autoremove

But the package "mysql-client-core-8.0" don't uninstall, so...

sudo apt --fix-broken install
sudo apt-get --reinstall install mysql-client-core-8.0
sudo apt-get purge mysql\* libmysql\*
sudo apt autoremove
sudo apt update
sudo apt install mysql-server

No more errors!


I see two problems here.

  1. 3 not fully installed or removed error. when you ran sudo apt update && sudo apt upgrade. It means that those packages are corrupted. You need to forcefully remove them. Run

    sudo apt-get autoclean && sudo apt-get --force-yes remove mysql-community-server-dbgsym mysql-community-server mysql-server
    
  2. Now the problem of MySQL not starting. You seem to have upgraded from 14.04 which left some obsolete packages like libmysqlclient18. (Bionic (18.04) has libmysqlclient20)

    Remove all packages related to MySQL and do a "clean installation" of MySQL. Run

    sudo apt remove --purge libapache2-mod-auth-mysql libmysqlclient18:i386 libmysqlclient18:amd64 mysql-common mysql-community-client mysql-community-client-core mysql-community-server mysql-community-server-core mysql-server
    

    Install MySQL again,

    sudo apt install mysql-server
    

Further Reading:

  • How to upgrade to MySQL 8.0? - Ask Ubuntu

  • How to reset or change the MySQL root password? - Stack Overflow

Tags:

Mysql

Ubuntu