I'm facing difficulties installing the MongoDB community server on Manjaro Linux.
There isn't official documentation on how to install it on Arch-based systems and Pacman can't find it in the AUR repos.
Has anyone ever tried to install it?
I'm facing difficulties installing the MongoDB community server on Manjaro Linux.
There isn't official documentation on how to install it on Arch-based systems and Pacman can't find it in the AUR repos.
Has anyone ever tried to install it?
Here is what I did to install.
As the package is not available in the official Arch repositories and can't be installed using pacman
, you need to follow a few steps to install it.
First, you need to get the URL for the repo of prebuilt binaries from AUR. It can be found here and by the time of writing this it was https://aur.archlinux.org/mongodb-bin.git
Simply clone the repo in your home directory or anywhere else. Do git clone https://aur.archlinux.org/mongodb-bin.git
, then head to the cloned directory, cd mongodb-bin
.
Now, all you need to do is to run makepkg -si
command to make the package. the -s
flag will handle the dependencies for you and the -i
flag will install the package.
After makepkg
finishes its execution, don't forget to start mongodb.service
. Run systemctl start mongodb
and if needed enable it with systemctl enable mongodb
.
Type mongo
in the terminal and if the Mongo Shell runs you are all set.
Later edit (8.2.2021): This package is now available in AUR.
pamac search -a mongodb
and then install it with pamac build mongodb
. –
Telugu pamac build mongodb
it just builds forever. I left it running for an hour and came back and still wasn't done. It looks like it's stuck in a dep check loop. Any idea how to work around that? –
Lampion pamac build mongodb-bin
;) –
Telugu It is available in AUR, so you can view it with pamac with -a flag, eg.
pamac search -a mongodb-bin
pamac info -a mongodb-bin
And, then build and install with (this can be done after manually cloning too) -
pamac build mongodb-bin
Note that there's also a package named mongodb
, but mongodb-bin
is a newer release (you can check the version numbers by search or info arguments)
I've been using mongodb via docker
for a couple of years.
In my experience, it's easier than installing the regular way. (assuming you already have docker installed)
If you don't already have it, you can install via pacman/pamac, because it's in the official Arch/Manjaro package repositories. The easiest way is to run the following command:
sudo pacman -S docker
sudo docker run -d -p 27017:27017 -v ~/mongodb_data:/data/db mongo
This command will run mongodb on a port 27017
, and place its data files into a folder ~/mongodb_data
.
If you're running this command for the first time, it will also download all the required files.
Now you're successfully running a local instance of mongodb, and you can connect it with your favorite db management tool or from your code.
docker exec -it mongodb bash
–
Glyph sudo docker run -d -p 27017:27017 -v ~/mongodb_data:/data/db --name MyMongo mongo:latest
then run docker exec -it MyMongo bash
–
Iniquity © 2022 - 2024 — McMap. All rights reserved.
pamac
(the other package manager) searches only withpamac search -a mongodb
- and finds something. – Telugu