Error while installing erpnext on ubuntu 18.04

Traceback (most recent call last):
File “install.py”, line 413, in
install_bench(args)
File “install.py”, line 135, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 327, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python3.6/subprocess.py”, line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=erpnext’]’ returned non-zero exit status 2.

pls help me resolve this error.

@Prashad_Nagarajan

Welcome:

Same issue:

Error in install on vps

Is that the whole error message? What is your installation command line exactly when you issued the command?

sudo -H python3 install.py --production --site localhost --user erpnext --mysql-root-password your_password --admin-password your_password --bench-name your_bench_name

when i gave this command i got the following error:
fatal: [localhost]: FAILED! => {
“cache_update_time”: 1577281300,
“cache_updated”: false,
“changed”: false,
“invocation”: {
“module_args”: {
“allow_unauthenticated”: false,
“autoclean”: false,
“autoremove”: false,
“cache_valid_time”: 0,
“deb”: null,
“default_release”: null,
“dpkg_options”: “force-confdef,force-confold”,
“force”: true,
“force_apt_get”: false,
“install_recommends”: null,
“name”: [
“nodejs”,
“npm”
],
“only_upgrade”: false,
“package”: [
“nodejs”,
“npm”
],
“policy_rc_d”: null,
“purge”: false,
“state”: “present”,
“update_cache”: true,
“upgrade”: null
}
},
“msg”: “‘/usr/bin/apt-get -y -o "Dpkg::Options::=–force-confdef" -o "Dpkg::Options::=–force-confold" --force-yes install ‘npm’’ failed: W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Unable to correct problems, you have held broken packages.\n”,
“rc”: 100,
“stderr”: “W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Unable to correct problems, you have held broken packages.\n”,
“stderr_lines”: [
“W: --force-yes is deprecated, use one of the options starting with --allow instead.”,
“E: Unable to correct problems, you have held broken packages.”
],
“stdout”: “Reading package lists…\nBuilding dependency tree…\nReading state information…\nSome packages could not be installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet been created\nor been moved out of Incoming.\nThe following information may help to resolve the situation:\n\nThe following packages have unmet dependencies:\n npm : Depends: nodejs but it is not going to be installed\n Depends: node-abbrev (>= 1.0.4) but it is not going to be installed\n Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed\n Depends: node-ansi-color-table but it is not going to be installed\n Depends: node-archy but it is not going to be installed\n Depends: node-block-stream but it is not going to be installed\n Depends: node-fstream (>= 0.1.22) but it is not going to be installed\n Depends: node-fstream-ignore but it is not going to be installed\n Depends: node-github-url-from-git but it is not going to be installed\n Depends: node-glob (>= 3.1.21) but it is not going to be installed\n Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed\n Depends: node-inherits but it is not going to be installed\n Depends: node-ini (>= 1.1.0) but it is not going to be installed\n Depends: node-lockfile but it is not going to be installed\n Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed\n Depends: node-minimatch (>= 0.2.11) but it is not going to be installed\n Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed\n Depends: node-gyp (>= 0.10.9) but it is not going to be installed\n Depends: node-nopt (>= 3.0.1) but it is not going to be installed\n Depends: node-npmlog but it is not going to be installed\n Depends: node-once but it is not going to be installed\n Depends: node-osenv but it is not going to be installed\n Depends: node-read but it is not going to be installed\n Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed\n Depends: node-request (>= 2.25.0) but it is not going to be installed\n Depends: node-retry but it is not going to be installed\n Depends: node-rimraf (>= 2.2.2) but it is not going to be installed\n Depends: node-semver (>= 2.1.0) but it is not going to be installed\n Depends: node-sha but it is not going to be installed\n Depends: node-slide but it is not going to be installed\n Depends: node-tar (>= 0.1.18) but it is not going to be installed\n Depends: node-underscore but it is not going to be installed\n Depends: node-which but it is not going to be installed\n”,
“stdout_lines”: [
“Reading package lists…”,
“Building dependency tree…”,
“Reading state information…”,
“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:”,
" npm : Depends: nodejs but it is not going to be installed",
" Depends: node-abbrev (>= 1.0.4) but it is not going to be installed",
" Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed",
" Depends: node-ansi-color-table but it is not going to be installed",
" Depends: node-archy but it is not going to be installed",
" Depends: node-block-stream but it is not going to be installed",
" Depends: node-fstream (>= 0.1.22) but it is not going to be installed",
" Depends: node-fstream-ignore but it is not going to be installed",
" Depends: node-github-url-from-git but it is not going to be installed",
" Depends: node-glob (>= 3.1.21) but it is not going to be installed",
" Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed",
" Depends: node-inherits but it is not going to be installed",
" Depends: node-ini (>= 1.1.0) but it is not going to be installed",
" Depends: node-lockfile but it is not going to be installed",
" Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed",
" Depends: node-minimatch (>= 0.2.11) but it is not going to be installed",
" Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed",
" Depends: node-gyp (>= 0.10.9) but it is not going to be installed",
" Depends: node-nopt (>= 3.0.1) but it is not going to be installed",
" Depends: node-npmlog but it is not going to be installed",
" Depends: node-once but it is not going to be installed",
" Depends: node-osenv but it is not going to be installed",
" Depends: node-read but it is not going to be installed",
" Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed",
" Depends: node-request (>= 2.25.0) but it is not going to be installed",
" Depends: node-retry but it is not going to be installed",
" Depends: node-rimraf (>= 2.2.2) but it is not going to be installed",
" Depends: node-semver (>= 2.1.0) but it is not going to be installed",
" Depends: node-sha but it is not going to be installed",
" Depends: node-slide but it is not going to be installed",
" Depends: node-tar (>= 0.1.18) but it is not going to be installed",
" Depends: node-underscore but it is not going to be installed",
" Depends: node-which but it is not going to be installed"
]
}

RUNNING HANDLER [mariadb : restart mysql] **************************************
task path: /tmp/.bench/playbooks/roles/mariadb/handlers/main.yml:2

PLAY RECAP *********************************************************************
localhost : ok=27 changed=7 unreachable=0 failed=1 skipped=21 rescued=0 ignored=0

Traceback (most recent call last):
File “install.py”, line 413, in
install_bench(args)
File “install.py”, line 135, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 327, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python3.6/subprocess.py”, line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=erpnext’]’ returned non-zero exit status 2.

What steps have you taken before installing?

@Prashad_Nagarajan

Did you take a look what I refered?

Just do:

sudo npm install -g yarn
cd frappe-bench
bench update

easy install

can u provide me the steps to install.

meaning?

didn’t you install the prerequisite packages?

now i am going to start a fresh install,so pls provide me the installation steps.

i have used the below steps:

I have installed fresh Ubuntu 18.0.4LTS
Ran the command apt-get update
Ran the command apt-get upgrade
Rebooted server
apt-get install python3-setuptools python3-minimal redis-server build-essential
created user erpnext

sudo adduser erpnext (Adding a new user erpnext)
usermod -aG sudo erpnext (giving proper permission)
su erpnext (login as erpnext user)

Download the installation script by running below command:
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

Then install the erpnext by using this command (it will take nearly 45 minits to run in 4GB virtualbox image, below command install all the requisite for erpnext (example nginx, mariadb etc ):

sudo -H python3 install.py --production --site localhost --user erpnext --mysql-root-password your_password --admin-password your_password --bench-name your_bench_name

i have checked it.

Just follow these steps on a new ubuntu 18.04
Fresh install: