It could happen that only mongodb-org
package was updated.
To check that you can run:
sudo apt list --installed | grep mongodb
All steps for upgrading 3.6 => 4.0
sudo systemctl stop mongod
wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo apt-key add -
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
Important part:
sudo apt-get update && sudo apt-get install -y mongodb-org=4.0.14 mongodb-org-server=4.0.14 mongodb-org-shell=4.0.14 mongodb-org-mongos=4.0.14 mongodb-org-tools=4.0.14
sudo systemctl start mongod
mongo -version
MongoDB shell version v4.0.14
...
mongod -version
db version v4.0.14
...
Btw, to check what's the latest patch version available run:
apt policy mongodb-org
That worked for me, I hope it will for you too :)
mongodb
installed and version 3.6.13 is the first one in your PATH hence it being referenced in your second output. The only one installed byapt
is4.0.10
which is why it specifies that it's already the latest version. Did you or someone else build another one from source on the system?