Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

ubuntu - Mongodb is not updated properly from 4.2 to 4.4

I was using mongodb 4.2.9 on ubuntu 18.04

I installed it with package manager. Now I to update it to 4.4 version used package manager following --> https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ instructions.

Installation was ok but when I write mongod -version command it shows - db version v4.2.9. I tried to re-install again it says mongodb-org is already the newest version (4.4.1). but mongod -version command it shows - db version v4.2.9. How can I get rid of this problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It looks like mongodb-org is the meta-package depending on all other packages, but it doesn't require dependent packages to be the same version as it is itself. This works fine for installation but doesn't update dependent packages if you install mongodb-org when you already have older individual packages installed.

To fix:

  • Simple solution - apt-get upgrade. All of the other MongoDB packages should get updated.
  • If that doesn't work, manually install all the other packages again: apt-get install mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools.

You also have mongodb-server in there, you should remove it if it's installed and if it's not installed you may consider purging it after ensuring you don't need any part of its configuration for your present deployment.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...