Удаление программы после случайного удаления папки установки

Как удалить или переустановить программу после того, как я случайно удалил папку установки?

Я случайно удалил папку /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

Конечно, папка не находится в корзине! Спасибо!

1
задан 7 October 2015 в 19:13

1 ответ

То, что я обычно делаю, это получить список файлов пакета, а затем уничтожить все эти файлы, а затем переустановить:

Удалить: apt-get remove spotify-client Полностью очистить файлы: apt-file list spotify-client | cut -d' ' -f 2 | xargs rm -rf Затем переустановить: apt-get install spotify-client
0
ответ дан 23 May 2018 в 16:53
  • 1
    Пункт 1 не работает. [F1]. Пункт 2: sudo: apt-file: command not found. – Sfrow 8 October 2015 в 11:06

Другие вопросы по тегам:

Похожие вопросы: