Ubuntu22.4系統(tǒng)mongodb數(shù)據(jù)庫安裝
1、打開終端并運行以下命令,以導入 MongoDB GPG 密鑰:
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
2、添加 MongoDB 倉庫到你的系統(tǒng)。根據(jù)你的 Ubuntu 版本,選擇適當?shù)膫}庫鏈接:
-
- 對于 Ubuntu 20.04(Focal Fossa):
echo"deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
-
- 對于其他版本,請?zhí)鎿Q
***\*$(lsb_release -cs)\****
為你的版本代號,然后運行以下命令:
- 對于其他版本,請?zhí)鎿Q
echo"deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
3、更新你的包列表:
sudo apt update
4、安裝 MongoDB 包:
sudo apt install -y mongodb-org
5、啟動 MongoDB 服務:
sudo systemctl start mongod
6、檢查 MongoDB 服務狀態(tài):
sudo systemctl status mongod
文章來源地址http://www.zghlxwxcb.cn/news/detail-656909.html
文章來源:http://www.zghlxwxcb.cn/news/detail-656909.html
到了這里,關于Ubuntu22.4系統(tǒng)mongodb數(shù)據(jù)庫安裝的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!