statoverride 文件中存在未知系统用户“mongodb”;

statoverride 文件中存在未知系统用户“mongodb”;

我正在尝试下载 mongodb Compass,但我的终端出现了这个奇怪的错误。我认为这是因为我之前删除了 mongodb,但我不知道如何解决这个问题。运行后sudo apt upgrade我收到此错误。

dpkg: unrecoverable fatal error, aborting:
 unknown system user 'mongodb' in statoverride file; the system user got removed
before the override, which is most probably a packaging bug, to recover you
can remove the override manually with dpkg-statoverride
E: Sub-process /usr/bin/dpkg returned an error code (2)

答案1

跑步

sudo sed -i '/mongodb/d' /var/lib/dpkg/statoverride

sudo apt install mongodb-org

答案2

您可以编辑该文件/var/lib/dpkg/statoverride,例如:

sudo nano /var/lib/dpkg/statoverride

并删除引用 mongodb 用户的两行。

相关内容