1

I was following a setup process of the ERPNext from here in a fresh Ubuntu 20.04 server but I'm stuck at command sudo apt -y install mariadb-server libmysqlclient-dev as I can't install mariadb in it.

The issue is

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.6 (>= 1:10.6.4+maria~hirsute) but it is not going to be installed

It was initially showing mariadb-server : Depends: mariadb-server only, then I followed some answers available on this website so it was changed to mariadb-server : Depends: mariadb-server-10.3 and after following the official site's instructions, it is now at ...10.6.

I've searched and looked on almost all questions and answers available on this website as well as on other websites, none helped. Also, I've tried installing the mariadb-server-client as suggested by the CLI but it didn't work either, I've tried installing the mariadb-server-core again as suggested by the CLI and it installed successfully but didn't help in installation of mariadb-server.

user535733
  • 62,253
  • 3
    Hmmm. The ERPNext instructions are ancient (17.04! Last updated in 2018!) and seem likely to have led you badly astray. Undo everything that those instructions told you to do. Most 20.04 users can install MariaDB Server 10.3 from the Ubuntu repositories with a single command: sudo apt install mariadb-server and nothing else. No other sources, no keys, no haywiring, nothing. If you need a specific version of MariaDB, you should say so in your Question above. If you need the newest version of all software, then you shouldn't be using an LTS release. – user535733 Sep 07 '21 at 19:20
  • @user535733 Thanks for the tip, I removed the repositories instead of undoing everything and it worked. See my answer. – Lalit Fauzdar Sep 08 '21 at 06:15

1 Answers1

0

Why it happened? The old versions of Ubuntu required the repository of mariadb to be added first before installing it. Now in 20.04, it's not required and the installation works directly, but as I followed an old tutorial, I added the repositories which caused the issue, so, the solution is to remove the repositories added.

The solution: So, as @user535733 suggested to undo everything, I looked at the instructions and found one repository of mariadb that I had added (using add-apt-repository command) but I had also added another one from mariadb's official site to install it.

So, the easy way was to remove these added repositories and for that I found this answer and typed a command sudo nano /etc/apt/sources.list and removed all the repositories containing mariadb and the installation of mariadb worked.