意外删除程序的安装文件夹后,如何删除或重新安装该程序?
我不小心删除了/opt/spotify/
文件夹,无法重新安装spotify-client
或清除它。
sudo apt-get purge spotify-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
spotify-client*
0 upgraded, 0 newly installed, 1 to remove and 45 not upgraded.
1 not fully installed or removed.
After this operation, 143 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 276312 files and directories currently installed.)
Removing spotify-client (1:0.9.17.1.g9b85d43.7-1) ...
/var/lib/dpkg/info/spotify-client.prerm: 9: cd: can't cd to /opt/spotify/spotify-client
dpkg: error processing package spotify-client (--purge):
subprocess installed 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:
spotify-client
E: Sub-process /usr/bin/dpkg returned an error code (1)
和
sudo apt-get install --reinstall spotify-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 45 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for spotify-client:amd64
当然,该文件夹不在垃圾桶中!谢谢!
您可以通过使用组合让周围的情况apt
和dpkg
。首先从存储库下载deb软件包
apt-get download <packagename>
然后安装.deb文件(位于当前文件夹中)
sudo dpkg -i <downloaded_package_file.deb>
如果这不起作用,请将--force-all
开关添加到dpkg
,即
sudo dpkg -i --force-all <downloaded_package_file.deb>
如果仍然无法使用,请同时添加 --no-triggers
sudo dpkg -i --force-all --no-triggers <downloaded_package_file.deb>
作为最后的选择(不推荐),您可以手动编辑/var/lib/dpkg/status
:
spotify-client
apt-get -f install spotify-client
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句