0

installing MongoDB on ubuntu wsl2


I tried to install MongoDB on WSL( ubuntu 20), after using this link but there is something wrong! I don't know what the heck is: systemd :"System has not been booted with systemd as init system (PID 1)" and how should I resolve that... I'm totally beginner in Linux experience. I've searched for this problem and apparently, people using DOCKTER in wsl had such a problem but I can't figure out how should I do in my case. thanks

The whole error:

Setting up mongodb-org-server (4.4.4) ...
System has not been booted with systemd as init system (PID 1). Cant operate.
Failed to connect to bus: Host is down
dpkg: error processing package mongodb-org-server (--configure):
installed mongodb-org-server package post-installation script subprocess returned error exit status 1
Setting up mongodb-org-shell (4.4.4) ...
Setting up mongodb-org-mongos (4.4.4) ...
Setting up mongodb-org-database-tools-extra (4.4.4) ...
dpkg: dependency problems prevent configuration of mongodb-org:
  mongodb-org depends on mongodb-org-server; however:
  Package mongodb-org-server is not configured yet.
    
dpkg: error processing package mongodb-org (--configure):
  dependency problems - leaving unconfigured
Setting up mongodb-org-tools (4.4.4) ...
  No apport report written because the error message indicates its a followup error from a previous failure.

Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
  mongodb-org-server
  mongodb-org    
1
  • AFAIK, wsl does not need systemd. I tried to install mongodb in wsl on my own, but I couldn't and I found that for some reasons it was not possible. Alternatively, I installed the mongodb server in windows and used it in wsl container. Commented Feb 27, 2021 at 4:20

1 Answer 1

-1

After lots of searches and trial and error, I found the only thing it apparently needs to do is: right after the MongoDB installation ("In this Lik"), we should set "systemctl" to enable! And then it needs to reboot your system.

sudo systemctl enable MongoDB
Sign up to request clarification or add additional context in comments.

3 Comments

Why is the answer selected? WSL/WSL2 does not come with systemd. Therefore running systemctl will just generate an error: System has not been booted with systemd as init system (PID 1).
@John Hanley is correct.
No way this will work for anyone

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.