ERPNext debian 8 install error

Hi I’ve installed ERPNext many times.
Now suddenly I get the following error:

user@host:~$ sudo bash --setup-production
[sudo] password for user:
Installing for debian 8 amd64
In case you encounter an error, you can post on

Adding debian mariadb repo line 140: =mariadb-server: command not found

How can I fix this?

It is all about the following part of the script:

$repo_test=$(apt-cache search --names-only ‘mariadb-server’)
if [ -z “$repo_test” ]; then
run_cmd sudo add-apt-repository “deb $CODENAME main”

Now when I run the apt-cache search --names-only ‘mariadb-server’ part manually I do get a response:

user@host:~$ apt-cache search --names-only ‘mariadb-server’
mariadb-server - MariaDB database server (metapackage depending on the latest version)
mariadb-server-10.0 - MariaDB database server binaries
mariadb-server-core-10.0 - MariaDB database core server files

So what does the if [ -z “$repo_test” ] part check?

Which install method are you using?
Off the top of my head I would update jessie and check to see if MarirDB is actually installed.
If so drop all databases and try running your frappe install script again.
If MariaDB is not installed then follow the info below provided by MariaDB:

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver 0xcbcb082a1bb943db
sudo add-apt-repository ‘deb [arch=amd64,i386] jessie main’
Once the key is imported and the repository added you can install MariaDB with:

sudo apt-get update
sudo apt-get install mariadb-server

Then try running the frappe install script again.


Hi @System19,

Thank you for your advice.
The problem was not the installation of MariaDB.
It was the script that should trigger the MariaDB installation.

I checked with a previous version of the setup script.
I saw that the whole $repo_test was new in this script.
So I edit the script and manually checked both states.
If statement returns “no”: (just removed the whole check) installation continu’s but returns an error the MariaDB is not installed (obvious).
if statement returns “yes”: (only kept the run_cmd part and removed the if part) installation continu’s and finishes without problems. Everything is working now.

So my problem is fixed now.

I still wonder what the If statement checks.
So what does the if [ -z “$repo_test” ] part do?
it is only there in the debian part of the installation script.