![ubuntu 20.04 LTS:mongod:加载共享库时出错:libnetsnmpmibs.so.30:无法打开共享对象文件:没有此文件或目录](https://linux22.com/image/932691/ubuntu%2020.04%20LTS%EF%BC%9Amongod%EF%BC%9A%E5%8A%A0%E8%BD%BD%E5%85%B1%E4%BA%AB%E5%BA%93%E6%97%B6%E5%87%BA%E9%94%99%EF%BC%9Alibnetsnmpmibs.so.30%EF%BC%9A%E6%97%A0%E6%B3%95%E6%89%93%E5%BC%80%E5%85%B1%E4%BA%AB%E5%AF%B9%E8%B1%A1%E6%96%87%E4%BB%B6%EF%BC%9A%E6%B2%A1%E6%9C%89%E6%AD%A4%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95.png)
我之前使用的是 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