半安裝包 - kibana

半安裝包 - kibana

我發現安裝/刪除/升級半安裝的 kibana 軟體包時遇到麻煩。我可能以錯誤的方式編輯了 kibana.yml 文件,並且無法使其恢復正常。

[09:32] ***-VM:cache$ sudo apt-get --purge remove kibana
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  kibana*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 124 MB disk space will be freed.
Do you want to continue? [Y/n] Y
dpkg: error processing package kibana (--purge):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
kibana
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

您可以使用以下方法來解決這種情況:

  1. 重新安裝然後刪除

    sudo apt-get install --reinstall kibana
    sudo apt-get remove kibana
    
  2. 單次移除,無需清除

    sudo apt-get remove kibana
    
  3. 強制安裝和拆卸

    sudo apt-get -f install
    sudo apt-get remove --purge kibana
    
  4. 強制移除dpkg

    sudo dpkg -r --force kibana
    

相關內容