我之前使用的是 ubuntu 18.04 LTS 和 mongodb-linux-x86_64-enterprise-ubuntu1604-4.2.1,运行正常,后来我升级到了 ubuntu 20.04 LTS,现在当我输入 mongod 命令时出现错误,错误如下
mongod: error while loading shared libraries: libnetsnmpmibs.so.30: cannot open shared object file: No such file or directory
我已经搜索过图书馆
sudo find / -name libnetsnmp.so.30* and
apt-cache search libsnmp30
它没有找到任何东西然后我尝试通过安装它
sudo apt-get install libsnmp30
它给
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libsnmp30 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libsnmp30' has no installation candidate
有人可以指导我吗
答案1
我刚刚遇到了同样的问题,我通过删除现有安装并重新安装解决了这个问题https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-ubuntu-tarball/(企业版)或https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
我假设为 Ubuntu 18.x 编译的版本使用了 Ubuntu 20.x 中不再可用的库
答案2
您将需要安装附加库(用于 bionic),如 mongo 网站上所述...
sudo apt-get install libcurl4 libgssapi-krb5-2 libldap-2.4-2 libwrap0 libsasl2-2 libsasl2-modules libsasl2-modules-gssapi-mit snmp openssl liblzma5