Debian
如何解決“無效的 SCRIPTWHITELIST 配置選項:不存在的路徑名:/bin/which”和在 Debian10->11 升級期間阻止無人值守升級?
我試圖通過以下方式將 Debian 10/KDE 升級到 Debian 11 Bullseye stable
sudo apt upgrade --without-new-pkgs
輸出是:
Preparing to unpack .../dh-autoreconf_20_all.deb ... Unpacking dh-autoreconf (20) over (19) ... Setting up aide-common (0.17.3-4) ... Replacing config file /etc/cron.daily/aide with new version cp: cannot remove '/etc/cron.daily/aide': Operation not permitted dpkg: error processing package aide-common (--configure): installed aide-common package post-installation script subprocess returned error exit status 1 Setting up dh-autoreconf (20) ... Processing triggers for man-db (2.8.5-2) ... Errors were encountered while processing: aide-common Invalid SCRIPTWHITELIST configuration option: Non-existent pathname: /bin/which E: Sub-process /usr/bin/dpkg returned an error code (1) E: Problem executing scripts DPkg::Post-Invoke 'if [ -x /usr/bin/rkhunter ] && grep -qiE '^APT_AUTOGEN=.?(true|yes)' /etc/default/rkhunter; then /usr/share/rkhunter/scripts/rkhupd.sh; fi' E: Sub-process returned an error code
然後我刪除了助手(
sudo apt-get remove aide
)並再次嘗試,安裝後它說:Invalid SCRIPTWHITELIST configuration option: Non-existent pathname: /bin/which E: Problem executing scripts DPkg::Post-Invoke 'if [ -x /usr/bin/rkhunter ] && grep -qiE '^APT_AUTOGEN=.?(true|yes)' /etc/default/rkhunter; then /usr/share/rkhunter/scripts/rkhupd.sh; fi' E: Sub-process returned an error code
然後我再次嘗試,但現在
unattended-upgr
正在執行,等待一段時間後它不會退出,在程序管理器中執行“結束程序”或向它發送 KILL 信號(即使現在它只是一個而不是兩個無人值守-upgr過程)。它似乎主要通過
lsb_release -a
返回版本:11。這些錯誤是否有問題,或者我應該簡單地重新啟動以解決它?如果是這樣,是否應該有一些需要重新啟動的消息(或更好的錯誤消息)?
您遇到了問題
rkhunter
,跟踪為Debian 錯誤 #932594。簡而言之,
rkhunter.conf
的路徑與您系統的路徑不匹配。您需要對其進行編輯以修復以下路徑which
:sed -i s,SCRIPTWHITELIST=/bin/which,SCRIPTWHITELIST=/usr/bin/which, /etc/rkhunter.conf
停止
unattended-upgrade
,殺死它killall -9 unattended-upgrade
然後尋找任何雜散
apt
或dpkg
相關的程序,如果它們沒有在合理的時間內退出,也將它們殺死。
您已經安裝並配置了rkhunter,以便在每次使用 apt 進行操作時執行。編輯
rkhunter.conf
並查看是否SCRIPTWHITELIST
設置為/bin/which
。那裡會有多個條目。將其更改為正確的路徑which
。或者您可以在每次執行 apt 時將 rkhunter 從執行中移除。