Good to know. I think I’ll let it simmer for a while before I upgrade to jammy and monogdb 6.0.
I see an issue in step9, I tried many workarounds but nothing worked.
I am using Ubuntu22.04 and trying to install the MongoDB package but getting an error “E: Unable to locate package mongodb-org” as a workaround tried to install “apt install -y mongodb” but then again getting the same issue “E: Unable to locate package mongodb”.
Please let me know if anyone can help here.
Thanks Alex, here are some commands to run the installation that don’t throw an error about apt-key being deprecated, and are slightly more secure:
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
sudo apt install mongodb-org
Happy to report that after far, far too many months following this issue @Toby_LL has provided the magic commands to install MongoDB v6 on Ubuntu 22.04. TYSM.
Any reason why the service wouldn’t also be installed with this approach? I’m not well versed in linux operation, but I think I have things installed correctly?
When I try to sudo service mongod start
like I used to, I get mongod: unrecognized service
.
systemctl list-units --all | grep mongo
and see what it says.
Thanks for the quick response @Jack_Woehr. I’m running WSL2 on windows 11. When I run that command, I get System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down
Thinking this may be an issue with WSL2?
Sounds like it’s WSL2. I know very little about Windows and WSL2.
Correct. It does not have a init system.
I think that this can run as a service but it is done in a wsl/windows way.
Start mongodb by invoking sudo -u mongodb mongod --config /etc/mongod.conf
As it is not being executed by the systemd units mongod will be running with the user mongodb ulimits, if you are doing anything other than light development adjust the ulimits.
Otherwise just install the windows version.
This is really should be its own topic as this isn’t just ‘MongoDB on Ubuntu 22.04’
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.