Errors when installing MongoDB on Ubuntu 20.04

i follow the official install instructionhttps://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

  • 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.

Hi @Danh_Le

You may have skipped over this section:

MongoDB 4.2 Community Edition supports the following 64-bit Ubuntu LTS (long-term support) releases on x86_64 architecture:

  • 18.04 LTS (“Bionic”)
  • 16.04 LTS (“Xenial”)

See the commenst from @Stennie Ubuntu 20.04 support
Mongodb error in Ubuntu 20.04

1 Like

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.

4.4 is not general availability. Basically be aware you are not running a currently supported configuration.

While the 4.4 release candidates are available, these versions of MongoDB are for testing purposes only and not for production use .

For new features in MongoDB 4.4, see Release Notes for MongoDB 4.4 (Release Candidate).

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.

1 Like