0

I have been trying to remove all the package.

apt-get remove --purge mysql*
apt-get remove --purge mysql
apt-get remove --purge mariadb
apt-get remove --purge mariadb*
apt-get --purge remove mariadb-server
apt-get --purge remove python-software-properties

But after apt-get remove --purge mysql*, they need me to run apt --fix-broken install first

Try to remove mariadb apt-get remove --purge mariadb* and get

`Failed to stop mysql.service: Unit mysql.service not loaded.`
/usr/bin/deb-systemd-helper: error: unable to read mariadb.service

Try to start mysql and get this

Failed to start mysql.service: Unit mysql.service not found.

What should i do to remove all of it?

  • what if you reinstall and then remove and purge? like sudo apt-get install -y mysql-server && sudo apt-get remove -y --purge mysql*, then with mariadb the same as sudo apt-get install -y mariadb-server && sudo apt-get remove -y --purge mariadb-server. I think mysql and mariadb install the same binary files ( mariadb is a drop-in replacement), so it will complain on the service on the second remove. – bistoco Nov 9 '18 at 7:22
  • @bistoco it said You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: mariadb-server-10.3 : PreDepends: mariadb-common (>= 1:10.3.10+maria~bionic) but it is not going to be installed Depends: mariadb-client-10.3 (>= 1:10.3.10+maria~bionic) but it is not going to be installed Depends: mariadb-server-core-10.3 (>= 1:10.3.10+maria~bionic) but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). – dionajie Nov 9 '18 at 7:31
  • @bistoco and install mariadb again but get error at Failed to start mysql.service: Unit mysql.service not found. invoke-rc.d: initscript mysql, action "start" failed. – dionajie Nov 9 '18 at 7:31
  • Try this, is using dpkg and forcing the uninstall. – bistoco Nov 9 '18 at 7:39
  • @bistoco i did sudo dpkg --purge --force-all package-name. For some package is succeced. then i execute dpkg -l | grep -e mysql -e mariadb, "mariadb-serber-10.3" is still there – dionajie Nov 9 '18 at 7:51
0

Try this:

  1. Purge mariadb

    sudo apt purge mariadb-*

    Remove all databases ('Yes' answer)

  2. Purge mysql

    sudo apt purge mysql-*

    Remove all databases ('Yes' answer)

  3. Remove mariadb repo form /etc/apt/sources.list

    Find something like this:

    deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.globo.tech/repo/10.4/ubuntu bionic main

  4. Remove folders:

    sudo rm -rf /usr/share/mysql/

    sudo rm -rf /etc/mysql/

    sudo rm -rf /lib/systemd/system/mysql.service

  5. Now you can try to install oracle mysql:

    sudo apt install mysql-server

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.