通过apt-get重新安装mongodb时出错

时间:2017-07-24 06:15:55

标签: mongodb uninstall raspberry-pi2 apt-get

我试图用apt-get install重新安装mongodb 但这会造成错误。

chown: invalid group: ‘mongodb:mongodb’
dpkg: error processing package mongodb-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mongodb:
 mongodb depends on mongodb-server (>= 1:2.4.1-2); however:
  Package mongodb-server is not configured yet.

dpkg: error processing package mongodb (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Processing triggers for systemd (215-17+deb8u7) ...
Errors were encountered while processing:
 mongodb-server
 mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我使用下一个命令但没有工作。

apt-get --reinstall install mongodb

sudo apt-get purge mongodb mongodb-clients mongodb-server mongodb-dev

sudo apt-get autoremove

并安装mongodb但它也不起作用。

当我先安装mongodb时, 我使用install.sh进行安装。

#!/bin/bash
if [ $(id -u) != 0 ]; then
    exec sudo -- "$0" "$@"
    exit
fi

echo "Creating mongodb user"
adduser --firstuid 100 --ingroup nogroup --shell /etc/false --disabled-password --gecos "" --no-create-home mongodb

echo "Installing mongo to /opt/mongo..."
tar xfz mongo.tar.gz -C /opt --owner mongodb

echo "Creating runtime directories under /var"
install -o mongodb -g nogroup -d /var/log/mongodb/
install -o mongodb -g nogroup -d /var/lib/mongodb/

echo "Installing config scripts"
install mongod /etc/init.d
install mongodb.conf /etc

echo "Setting mongod to start on boot"
update-rc.d mongod defaults

echo "Starting mongod"
/etc/init.d/mongod start

echo "done."

如何卸载mongodb?

0 个答案:

没有答案