Ubuntu

子程序安裝的預刪除腳本返回錯誤退出狀態 5

  • February 1, 2018

嘗試獲取clamavclamav-daemon解除安裝,但似乎apt並被dpkg卡住,沒有此錯誤,任何事情都無法完成:

dpkg --remove輸出:

(Reading database ... 385080 files and directories currently installed.)
Removing clamav-daemon (0.99.2+dfsg-0ubuntu0.16.04.2) ...
Failed to stop clamav-daemon.socket: Unit clamav-daemon.socket not loaded.
dpkg: error processing package clamav-daemon (--remove):
subprocess installed pre-removal script returned error exit status 5
/usr/bin/deb-systemd-helper: error: unable to read clamav-daemon.service
/usr/bin/deb-systemd-helper: error: unable to read clamav-daemon.socket
Errors were encountered while processing:
clamav-daemon

任何類型的apt命令都會將其添加到末尾:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
clamav-daemon : Depends: clamav-base (= 0.99.2+dfsg-0ubuntu0.16.04.2) but 0.99.3+addedllvm-0ubuntu0.16.04.1 is installed
                Recommends: clamdscan but it is not installed
E: Unmet dependencies. Try using -f.

我已經嘗試過apt -f install,嘗試過dpkg --configure -a,嘗試安裝然後刪除,嘗試製作假文件clamav-daemon.service/socket以希望腳本能夠接受並繼續。沒有任何幫助,我沒有想法。

任何幫助是極大的讚賞。

可在以下路徑中找到預刪除腳本。

/var/lib/dpkg/info/clamav-daemon.prerm

您應該能夠編輯此腳本以刪除失敗的部分。或者,您可以完全刪除腳本,但這可能會跳過其他清理步驟。

引用自:https://serverfault.com/questions/894878