我正在尝试在Linux中安装东西(Crunchbang Linux - Debian的衍生版),我收到的错误指向mongodb-20gen。
当我尝试使用以下方法删除它时: -
cometbill@Linuxn00b:~$ sudo apt-get remove mongodb-10gen
我明白了......
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
mongodb-10gen
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 221 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 81657 files and directories currently installed.)
Removing mongodb-10gen ...
arg: remove
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--remove):
subprocess installed pre-removal script returned error exit status 100
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
我在这里读了一些与MongoDB有类似错误的内容,并建议删除mongo-clients,所以,我试过了: -
cometbill@Linuxn00b:~$ sudo apt-get remove mongodb-clients
并获得: -
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mongodb-clients' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-10gen (2.4.6) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案 0 :(得分:8)
这是一个难以摆脱的状态。如果您创建一个假的init脚本,您应该能够完成删除:
sudo touch /etc/init.d/mongodb
sudo chmod 755 /etc/init.d/mongodb
答案 1 :(得分:3)
这是由于软件包管理器dpkg本身存在一些损坏,来自Ask Ubuntu的这个帖子:https://askubuntu.com/questions/195950/package-system-broken-e-sub-process-usr-bin-dpkg-returned-an-error-code-1列出了一些解决方案,更具体地说,状态文件的编辑已经被注意到总是有效的。
答案 2 :(得分:2)
对于mongodb v3.4
sudo touch /etc/init.d/mongod
sudo chmod 755 /etc/init.d/mongod
答案 3 :(得分:1)
您可以强制安装软件包:
sudo dpkg -i --force-all /var/cache/apt/archives/mongodb-org-tools_3.6.5_amd64.deb
然后通过以下方式恢复:
sudo apt-get install -f
答案 4 :(得分:1)
sudo nano /var/lib/dpkg/statoverride
然后删除前2行,然后重试
**mongodb mongodb 755 /var/log/mongodb
mongodb mongodb 755 /var/lib/mongodb**
root crontab 2755 /usr/bin/crontab
root mlocate 2755 /usr/bin/mlocate
root ssl-cert 710 /etc/ssl/private
root messagebus 4754 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
答案 5 :(得分:0)
根据你的问题,这个过程将会突破。
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
你必须创建假文件,
sudo touch /etc/init.d/mongodb
sudo chmod 755 /etc/init.d/mongodb
并且流程将完成。