前言
记录解决安装中存在的问题的方法
安装
👉 安装教程 链接可能需要魔法才能打开
一、缺失libssl1.1
1. 将 focal-security 添加到源列表
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
2. 安装libssl1.1
sudo apt install libssl1.1
二、wsl2无法启动mongodb服务
使用下面命令启动会报错
sudo systemctl start mongod
出现 System has not been booted with systemd as init system (PID 1). Can’t operate.
解决的方法(windows11)
现在windows11中的wsl已经👉官方支持🥰
1. 编辑 /ect/wsl.conf
sudo vim /ect/wsl.conf
添加下面内容
[boot]
systemd=true
保存后关闭wsl
2. 在PowerShell中运行下面的命令
wsl.exe --shutdown
之后就能正常的启动mongodb服务了
sudo systemctl start mongod
sudo systemctl status mongod
总结
为了在ubuntu22.04(wsl)中安装mongodb,我花了几个小时的来查找解决上述问题的方法,最后终于完成了正常安装
如果本文对你有帮助, 帮我点个赞👍(关注更好🥰