how to upgrade mongodb 3.6 to 4.2 in ubuntu code example Example: update mongodb version to 4 ubuntu mongodb-org is already the newest version (4.0.10).