问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/63862784/mongodb-is-not-updated-properly-from-4-2-to-4-4