
我不小心刪除了 Spotify 資料夾,現在我無法使用 apt-get 或軟體中心卸載程序,當我嘗試從命令列刪除 flash 插件時,出現以下錯誤:
/var/lib/dpkg/info/spotify-client.postinst: 5: /var/lib/dpkg/info/spotify-client.postinst: ./register.sh: not found
dpkg: error processing package spotify-client (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
spotify-client
E: Sub-process /usr/bin/dpkg returned an error code (1)
怎麼辦?
答案1
由於看起來 Spotify 軟體包仍處於「已配置」狀態,但刪除了其中的一些文件,因此您需要先重新安裝它:
sudo apt-get install -f --reinstall spotify-client
然後你應該可以正常卸載它:
sudo apt-get remove spotify-client
答案2
從儲存庫下載 Spotify-client deb 套件:
cd ~/Downloads && apt-get download spotify-client
安裝它dpkg
sudo dpkg -i --force-all --no-triggers downloaded_deb
如果有效,您將能夠正確刪除它。
如果它不起作用但返回127
錯誤,您可能需要重新安裝dpkg
,這是克服軟體包未完成安裝的提示(在您的情況下,Spotify 的資料夾被意外刪除)。一旦dpkg
重新安裝,您就重做該命令sudo dpkg -i --force-all --no-triggers downloaded_deb
。
答案3
你試過了嗎?
sudo apt-get purge spotify-client
sudo apt-get install -f spotify-client