Debian multipath-tools升级失败解决办法

debian wheezy升级multipath-tools时出现错误,升级失败

错误提示:

Device does not exist.
Command failed
invoke-rc.d: initscript multipath-tools, action “stop” failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1

这是由于旧版multipath-tools init脚本存在错误所致,可以通过提取升级包中的init脚本替换当前init脚本来解决:

1
2
3
4
5
6
7
8
$ cp /var/cache/apt/archives/multipath-tools_0.4.9+git0.4dfdaf2b-6_amd64.deb /tmp
$ cd /tmp
$ aunpack multipath-tools_0.4.9+git0.4dfdaf2b-6_amd64.deb
# mv /etc/init.d/multipath-tools /etc/init.d/multipath-tools-1
# cd /tmp/multipath-tools_0.4.9+git0.4dfdaf2b-6_amd64
# cp etc/init.d/multipath-tools /etc/init.d/multipath-tools
# /etc/init.d/multipath-tools restart
# rm /etc/init.d/multipath-tools-1

如果没有aunpack命令则需要安装包atool

之后重新执行升级指令即可

1
#apt-get dist-upgrade