尽管出现错误,但还是使用 dpkg 强制删除软件包

尽管出现错误,但还是使用 dpkg 强制删除软件包

我认为这是 Ubuntu Vivid 特有的,因为现有的解决方案都无济于事:

到目前为止我找到的所有解决方案都建议dpkg --purge --force-all,但这是我在 Ubuntu Vivid 下得到的:

% dpkg --purge --force-all modemmanager
(Reading database ... 124407 files and directories currently installed.)
Removing modemmanager (1.4.0-1) ...
invoke-rc.d: unknown initscript, /etc/init.d/modemmanager not found.
dpkg: error processing package modemmanager (--purge):
 subprocess installed pre-removal script returned error exit status 100
invoke-rc.d: unknown initscript, /etc/init.d/modemmanager not found.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
 modemmanager

答案1

随后立即找到解决方案:

% > /etc/init.d/modemmanager

% dpkg --purge --force-all modemmanager
(Reading database ... 124407 files and directories currently installed.)
Removing modemmanager (1.4.0-1) ...
Purging configuration files for modemmanager (1.4.0-1) ...
Processing triggers for man-db ...

即创建一个空的启动脚本/etc/init.d/modemmanager

相关内容