0

I recently upgraded from Ubuntu 20.04 to Ubuntu 22.04, then uninstalled MongoDB 4.2.

I then followed the instructions on the MongoDB website, to install MongoDB 6.0 and installed the server and tools, which is supposed to automatically install mongosh (mongodb-mongosh) and mongoimport:

apt-get install -y mongodb-org mongodb-database-tools

Following the answers on MongoDB.service failed with result exit-code I managed to get mongod (MongoDB 6.0) to run.

I know mongodb is running because I get:

# mongod --version
db version v6.0.6
Build Info: {
    "version": "6.0.6",
    "gitVersion": "26b4851a412cc8b9b4a18cdb6cd0f9f642e06aa7",
    "openSSLVersion": "OpenSSL 3.0.2 15 Mar 2022",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "ubuntu2204",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}

My issue is that I get the errors:

# mongo
mongo: command not found
# mongosh
mongosh: command not found
# mongoimport
mongoimport: command not found

I have also tried reinstalling and rebooting.

I have access to the server via Compass, but no access via Bash. What am I missing?

contemplator
  • 356
  • 3
  • 11
  • 1
    Does this answer your question? [mongo.exe not installed in Version 6.0.0](https://stackoverflow.com/questions/73081708/mongo-exe-not-installed-in-version-6-0-0) – Wernfried Domscheit Jun 03 '23 at 10:07
  • `mongod --version` does not show that it is running, you just print the version. On way to check if it runs, is to have a look at the logfile. Or check the service status. – Wernfried Domscheit Jun 03 '23 at 10:09
  • 1
    ok, @WernfriedDomscheit, I also did `service mongod status` and got `Active: active (running)`. So I know it's running. But my ability to access it via Compass and add collections is further proof. – contemplator Jun 04 '23 at 11:25
  • @WernfriedDomscheit, does that mean, `apt-get install -y mongodb-mongosh` does not install the shell from package manager? – contemplator Jun 04 '23 at 11:28
  • `install mongodb-mongosh` will install the shell, what else do you expect? However, the server package does not (anymore) include the shell. – Wernfried Domscheit Jun 04 '23 at 13:03

0 Answers0