Debian

無人值守升級失敗

  • April 29, 2018

我在 apt-get upgrade 上不斷收到此錯誤:

Installing unattended-upgrades (0.93.1+nmu1) ...
Failed to start unattended-upgrades.service: Unit unattended-upgrades.service failed to load: Invalid argument. See system logs and 'systemctl status unattended-upgrades.service' for details.
invoke-rc.d: initscript unattended-upgrades, action "start" failed.
● unattended-upgrades.service - Unattended Upgrades Shutdown
  Loaded: error (Reason: Invalid argument)
  Active: inactive (dead)
    Docs: man:unattended-upgrade(8)

jun 06 18:29:32 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:29:32 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:29:32 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:32:41 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:32:41 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:32:41 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:32:41 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:33:24 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:33:24 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
jun 06 18:33:24 PRODUCTION systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
dpkg: erro ao processar o pacote unattended-upgrades (--configure):
subprocesso script post-installation returned exit status code 6
Errors were found while processing:
unattended-upgrades
E: Sub-process /usr/bin/dpkg returned an error code (1)

我不關心無人值守的升級,它可以被刪除。我嘗試了 apt-get remove 但沒有運氣:

Removing unattended-upgrades (0.93.1+nmu1) ...
Failed to stop unattended-upgrades.service: Unit unattended-upgrades.service not loaded.
invoke-rc.d: initscript unattended-upgrades, action "stop" failed.
dpkg: error processing package unattended-upgrades (--remove):
subprocess script pre-removal returned exit status error 5
Errors were found while processing:
unattended-upgrades
E: Sub-process /usr/bin/dpkg returned an error code (1)

這些消息已被翻譯,因為其中一些不是英文的。

我有配置了 sid 儲存庫的 debian jessie。

unname -a: Linux PRODUCTION 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux

貓 /etc/debian_version: 9.0

我只是希望那個討厭的錯誤消失,我不在乎如何。通過刪除軟體包或修復問題,但我似乎無法刪除它,由於缺乏知識,我也無法修復它:)

有什麼提示嗎?

systemctl mask unattended-upgrades

解釋:

管理員可以覆蓋 systemd 單元,將具有相同名稱的文件放入/etc/systemd/system.

此機制還可用於“屏蔽”服務,使其不被套接字啟動、手動啟動或任何其他方法啟動。如果存在指向 的符號連結,而不是創建具有相同名稱的文件/dev/null,則該單元將被有效地忽略。

因此,您可以使用 ab(use)systemctl mask來替換單元的內容。

為避免將來可能發生混淆,請在取出包裝後檢查是否取下了面罩。 systemctl unmask unattended-upgrades.

引用自:https://unix.stackexchange.com/questions/369561