Debian

如何修復 etckeeper 或解除安裝它,以便 apt 安裝/刪除新軟體包?

  • July 24, 2021

作業系統: lxc內的 Debian Buster 10.10

我正在嘗試安裝一個新軟體包(我嘗試了不同的軟體包)並且 apt(和 DPkg)抱怨以下錯誤消息:

/etc/etckeeper/pre-install.d/README: 1: /etc/etckeeper/pre-install.d/README: Files: not found
/etc/etckeeper/pre-install.d/README: 2: /etc/etckeeper/pre-install.d/README: etc.: not found
/etc/etckeeper/pre-install.d/README: 3: /etc/etckeeper/pre-install.d/README: uncommitted: not found
E: Problem executing scripts DPkg::Pre-Invoke 'if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi'
E: Sub-process returned an error code

我決定解除安裝 etckeeper 並得到完全相同的錯誤消息。

我的Google搜尋/搜尋似乎缺乏。我的理由是問題出在 etckeeper 上,儘管我可能是錯的。

編輯:使用從此處找到的更多資訊進行更新。我重命名了以下目錄並重新創建了它們:

/etc/etckeeper/  
   pre-install.d
   post-install.d  
   unclean.d 

它允許我安裝新的軟體包。

如果你想一起擺脫 etckeeper:

rm -rf /var/lib/dpkg/info/etckeeper.*  
rm -rf /usr/share/etckeeper  
rm -rf /etc/default/etckeeper  
rm -rf /etc/init.d/etckeeper  
apt-get purge etckeeper  
mv /usr/bin/etckeeper /usr/bin/etckeeper.bak  
mv /etc/etckeeper/ /etc/etckeeper.bak  

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