无法删除(或重新安装)Spotify 或任何其他程序

无法删除(或重新安装)Spotify 或任何其他程序

不久前我安装了 Spotify,但后来删除了其中的一些文件夹(意外的 rm-rf 操作 - 糟糕的事情发生了)。

我现在无法通过 apt-get 安装任何软件(pip 工作正常)

当我跑步时

sudo apt-get -f install

我得到以下

>(Reading database ... 586089 files and directories currently installed.)
Preparing to unpack .../spotify-client_1%3a0.9.11.26.g995ec04.78-1_amd64.deb ...
/var/lib/dpkg/info/spotify-client.prerm: 9: cd: can't cd to /opt/spotify/spotify-client
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 9: cd: can't cd to /opt/spotify/spotify-client
dpkg: error processing archive /var/cache/apt/archives/spotify-client_1%3a0.9.11.26.g995ec04.78-1_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 2
/var/lib/dpkg/info/spotify-client.postinst: 5: cd: can't cd to /opt/spotify/spotify-client
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/spotify-client_1%3a0.9.11.26.g995ec04.78-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

它说无法进入 /opt/spotify/spotify-client(因为那是我删除的)

修复建议?

我非常乐意彻底删除 Spotify

我已经尝试了以下所有方法

sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install [some package] fails

全部失败,因为找不到 spotify-client

我尝试将其从 /etc/apt/sources.list 中删除,但没有成功

答案1

系统尝试安装 Spotify。创建一个/opt/spotify/spotify-client由 root 拥有且权限为 755 的目录,然后重试。如果您还删除了/opt/spotify,请对该目录执行相同操作。然后重复sudo apt-get -f install、 和sudo apt-get remove spotify

答案2

下载 spotify 的 deb 文件并tar.gz使用以下命令将其转换为存档:

alien --to-tgz spotify*.deb

解压缩并解压档案:

tar xzf spotify*.tgz

opt/spotify文件夹复制到原始位置 ( /opt/spotify)。

相关内容