在选择Ubuntu上安装的MongoDB版本时,您需要考虑以下几个因素:
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ archamd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl start mongod
sudo systemctl enable mongod
请注意,MongoDB官方可能不再为某些旧版本的Ubuntu提供支持,例如MongoDB 5.0 Community Edition不再支持Ubuntu 16.04和18.04的x86_64架构。因此,在选择版本时,请确保所选版本得到官方支持并且与您的Ubuntu版本兼容。