I\'ve already seen these answers, so please don\'t link em in solutions:
Installing MongoDB on Ubuntu 16.04 https://unix.stackexchange.com/questions/220
Have you checked inodes on the server?
df -h may still show space left but you could be out of inodes. Please try running
df -i and see if you have any inodes left on the server.
Run the below command:
sudo apt-get -f install
And then try running
sudo apt-get install -y mongodb-org
Have you done the update?
sudo apt-get update && sudo apt-get upgrade
If the update does not help, try checking for broken dependencies:
sudo apt-get check
The check command is a diagnostic tool. It used to update package cache and checks for broken dependencies.
I would also try two more things. First,
sudo dpkg --configure -a sudo apt-get -f install
and if that does not help, try to unblock the dpkg
sudo rm -rf /var/lib/apt/lists/partial/* sudo apt-get -f install
I hope it helps.
Download the MongoDB Community Server (.dbz) version
Extract it and move it to home directory
Edit the ~/.profile by running:
Then add this:
echo export PATH=mongodb-linux-x86_64-ubuntu1804-4.0.4/bin:$PATH
Save then update the system variables by running:
After that, start server by running:
For installing mongodb 4.0 in ubuntu 16.04
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list sudo apt install libcurl3 sudo apt-get update sudo service mongod start mongo
I have tried many answers, but at last, I found that make system version is not matched to the mongo repo required version. At MongoDB official website, there is an option to let you choose the correct repo link. So, check your system version firstly with:
Then if your system version is 18.04, try
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
If your system version is 16.04, try
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list