When i came to this step:
sudo apt-get install -y mongodb-org
i got the error as below at the end of the lines:
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.2.8_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.2.8_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
i got the picture you can see it.
Thanks for reply @chris i installed version 4.4 and follows some instructions on Stackoverflow which i dont even rememer what i did lol. but i made progress, i could active the mongo sever but could active the mongod command, every time i type mongod i got Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted i trying to change the port… any advice i should know?
hi @chris just let you know. i got my error fixed. by sudo mkdir -p /data/db and run mongodb with sudo mongod i works greet now, i am so happy its been four days thanks god.
The official packages come with integrations for the appropriate init system(systemd, system v init). Negating the need to execute mongod manually.
You are effectively running this mongod as root, not a good practice, and you may run into file/directory permissions later if you transition to using it the ‘regular’ way.
Although you have the installation guide you have not diligently applied it’s guidance and wisdom, luck be with you.