I want to install mongo db on my local ubuntu system.
SHould i run
sudo apt-get install mongodb or sudo apt-get install mongodb-org
And how do i install the latest stable version only of mono db ?
My os version are
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
You can install either the latest stable version of MongoDB or a specific version of MongoDB.
To install the latest stable version:
sudo apt-get install -y mongodb-org
To install a specific release, you must specify each component package individually along with the version number:
sudo apt-get install -y mongodb-org=6.0.2 mongodb-org-database=6.0.2 mongodb-org-server=6.0.2 mongodb-mongosh=6.0.2 mongodb-org-mongos=6.0.2 mongodb-org-tools=6.0.2
REF: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/
Related
tried to get specific .rpm package for mongo database for Red hat 8 but cannot find to 4.4.0 version
yum install mongodb 4.4.0
but cannot get the packages for this
MongoDB 4 is available on MongoDB yum repository. Add the repository to your RHEL 8 server by running below commands:
sudo tee /etc/yum.repos.d/mongodb-org-4.repo<<EOF
[mongodb-org-4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
EOF
You need to run the commands above as user with sudo privileges.
Once the repo has been added, install mongodb-org package.
sudo yum install mongodb-org
the result should be:
$ rpm -qi mongodb-org-server
Name : mongodb-org-server
Version : 4.4.8
Release : 1.el8
How to install the last LibreOffice version by the apt-get command? I ran the followed commands at a Ubuntu 16.04 and just got version 6.2.8.2 but the last official one is 6.4.
sudo apt-add-repository ppa:libreoffice/ppa
sudo apt update
sudo apt upgrade
sudo apt install libreoffice
Second the official developers, LibreOffice-official-version Ubuntu 16.04 should be 5.1.6~rc2-0ubuntu1~xenial10. Because I had manually added sudo apt-add-repository ppa:libreoffice/ppa I was able to got libreoffice 6.2.8.2.
To achieve the 6.4 and newer installation they recommend to download the package or simple use sudo snap install libreoffice.
I am trying to install Mongodb using the command sudo apt-get install -y mongodb-org on ubuntu 16.04 after it produces the following error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mongodb-org : Depends: mongodb-org-shell but it is not going to be installed
Depends: mongodb-org-server but it is not going to be installed
Depends: mongodb-org-mongos but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Looking at the MongoDB Documentation at https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ it says to use their package not the Ubuntu APT package.
Here are the steps to use the MongoDB Package in a nutshell...
Add the APT Key:
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
Add the APT Sources List:
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
Update APT:
sudo apt-get update
Install the MongoDB Community Edition Package:
sudo apt-get install -y mongodb-org
Start the service:
sudo service mongod start
Log into the database using mongoshell:
mongo
If someone else struggle with this issue and all the other answers didn't work...
This is what work for me:
apt-get install mongodb-org-shell
apt-get install mongodb-org-server
apt-get install mongodb-org-mongos
And then again
sudo apt-get install -y mongodb-org
Detials (run uname -a):
Linux resta-dev 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I got this issue when the wrong Ubuntu version was selected. Make sure you double check that you run the correct one.
Your system already had the Ubuntu MongoDB package installed prior to installing the official mongodb-org packages. To confirm whether the host has the Ubuntu mongodb package installed, run;
sudo apt list --installed | grep mongo
If present you will need to remove all the installed mongodb-org packages by running;
sudo apt remove mongo*
Once all the MongoDB packages are removed you can now use the Official installation Guide to complete your installation
Use this command to display the installed applications and their dependencies causing troubles:
sudo dpkg --configure -a
and use the following command and replace package-name with the name of the package that need to be removed
sudo dpkg --remove package-name
You are now good to go.
Getting error message while connecting to database using Laravel 5.4 and Mongodb 3.6
The "SCRAM-SHA-1" authentication mechanism requires libmongoc built with --enable-ssl
Its running fine in ubuntu 16.04 with same versions, but not in AWS Linux.
Installed LAMP [ php70, apach24 ] :
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
Installed Mongodb [ 3.6 ] :
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-amazon/
Installed php-mongodb driver for php7:
sudo yum -y install php7-pear php70-devel gcc // completed
sudo pecl7 install mongodb // completed
sudo yum install openssl-devel // completed
php-mongodb driver installed and updated to php.ini, mongodb shows in phpinfo() as well.
we find there is libmongoc ssl disabled from phpinfo, Is that issue ?
How can we enable it ?
On Ubuntu 18.04 LTS, PHP 7.2.7
I had to install some extra packages:
sudo apt-get install -y libcurl4-openssl-dev pkg-config libssl-dev
Then re-install mongodb:
sudo pecl uninstall mongodb
sudo pecl install mongodb
Then check that SSL is enabled:
php -i | grep mongo
/etc/php/7.2/cli/conf.d/20-mongodb.ini,
mongodb
libmongoc bundled version => 1.11.0
libmongoc SSL => enabled
libmongoc SSL library => OpenSSL
libmongoc crypto => enabled
libmongoc crypto library => libcrypto
Restart php:
sudo service php7.2-fpm restart
Error, because of disabled libmongoc SSL and libmongoc Crypto from php-mongodb driver and enabled by following command.
sudo pecl7 config-set php_ini /etc/php.ini
After installing mongodb driver sudo pecl7 install mongodb, we should set the above.
now runs fine.
For those who have the error on an Alpine docker. You must add in your Dockerfile :
RUN apk add curl-dev openssl-dev
instead of sudo apt-get install -y libcurl4-openssl-dev pkg-config libssl-dev
I used RUN pecl config-set php_ini /etc/php.ini too
I get the same message using docker. I add to my Docker file
apt-get install -y libcurl4-openssl-dev pkg-config libssl-dev
and run
docker-compose up -d --build
Here is how I solved in CentOS 7
Remove mongodb extension:
pecl uninstall mongodb
Install openssl
sudo yum install openssl-devel
Reinstall MongoDB extension again
pecl install mongodb
On my Debian 9 module compillation fails with following error:
configure: error: OpenSSL libraries and development headers could not
be found
If you have same error try following:
apt-get remove libssl-dev
apt-get install libssl1.0-dev
As for me, this command does everything on Debian 9 and php 7.0
sudo apt-get install php-mongodb
Just restart Apache2 service afterwards
How do I install latest version of mongodb-clients on Ubuntu using apt-get?
apt-get install mongodb-clients only installs version 2.4.9.
On Ubuntu 16.04 to get the 4.2 mongo client
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update
sudo apt-get install mongodb-org-shell
Use official MongoDB Documents they already mentioned how to install a version of your choice. Steps for installation for Ubuntu 12.04 and 14.04
For Ubuntu 16.04 use this
NOTE:- Before that beware that you don't have any existing repository file for MongoDB. You can check using sudo apt-get update.While updating it will show if you have any. If you have then delete it using sudo rm /etc/apt/sources.list.d/mongodb*.list and then install MongoDB
For mongodb 3.2, below packages are supported. In order to use mongo shell, you need to install mongo-org-shell. Choose the right package according to your requreiements.
install mongodb on ubuntu
One could install a mongodb shell on Ubuntu 18.04 by following these instructions or by using an Ansible like .
At the time of writing, this ansible role installed version 4.2.5 of the mongo shell:
user#some-host:~/some-dir$ mongo --version
MongoDB shell version v4.2.5
git version: x
OpenSSL version: OpenSSL y
allocator: z
modules: none
build environment:
distmod: ubuntu1804
distarch: x86_64
target_arch: x86_64
20.04 focal is not setup yet, but you can use the instructions for bionic (18.04) successfully. I did!
Ray.