it-swarm-eu.dev

comment supprimer un package dont le script de post-installation et de pré-suppression échoue?

J'ai un problème avec le paquet openqrm.

Comment puis-je le supprimer?

[email protected]:/# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? 
Setting up openqrm (4.6-ubuntu1) ...
.: 33: Can't open /usr/share/openqrm/etc/openqrm-server.conf
dpkg: error processing openqrm (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 openqrm
E: Sub-process /usr/bin/dpkg returned an error code (1)

[email protected]:/# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up openqrm (4.6-ubuntu1) ...
.: 33: Can't open /usr/share/openqrm/etc/openqrm-server.conf
dpkg: error processing openqrm (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 openqrm
E: Sub-process /usr/bin/dpkg returned an error code (1)

[email protected]:/# apt-get remove --purge openqrm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libshadow-Ruby1.8 bind9 libopenipmi0 nagios-plugins-basic open-iscsi
  nagios-plugins-standard memcached libupsclient1 collectd-core nagios-images
  bind9utils tftpd-hpa radiusclient1 libdbi0 libphp-adodb collectd libruby
  aoetools facter dhcp3-server open-iscsi-utils liboping0 libmemcached2
  libradius1 libyajl1 nagios-plugins puppet-common puppetmaster
  libopenssl-Ruby1.8 libopenssl-Ruby libesmtp5 libxmlrpc-Ruby
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  openqrm*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 78.2MB disk space will be freed.
Do you want to continue [Y/n]? 
(Reading database ... 313464 files and directories currently installed.)
Removing openqrm ...
.: 32: Can't open /usr/share/openqrm/etc/openqrm-server.conf
dpkg: error processing openqrm (--purge):
 subprocess installed pre-removal script returned error exit status 2
.: 33: Can't open /usr/share/openqrm/etc/openqrm-server.conf
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 openqrm
E: Sub-process /usr/bin/dpkg returned an error code (1)
[email protected]:/# 
25
Marc Riera

Vous pouvez essayer de mettre à niveau le package avant de le purger. Dans certains cas, le nouveau package corrige le script de suppression (dpkg est conçu pour que les nouveaux packages puissent même corriger les scripts de transition des anciens packages).

Si cela ne fonctionne pas, jetez un œil à /var/lib/dpkg/info/openqrm.postinst comme l'a suggéré Kyle, localisez la ligne qui échoue, commentez-la et essayez à nouveau de purger. Répétez jusqu'à succès.

21
ℝaphink

Ce qui suit a fonctionné pour moi:

  • rm -rf /var/lib/dpkg/info/openqrm.*
  • rm -rf/usr/share/openqrm
  • rm -rf/etc/default/openqrm
  • rm -rf /etc/init.d/openqrm
  • apt-get purge openqrm
18
Matthias Toscanelli

Essayez simplement de toucher le fichier manquant. S'il ne s'agit que d'un fichier manquant, cela pourrait être une excellente solution de contournement.

touch /usr/share/openqrm/etc/openqrm-server.conf

Essayez maintenant de supprimer le paquet avec apt-get ou aptitude.

7
Fbo

Regardez /var/lib/dpkg/info/openqrm.postinst et voyez ce qu'il essaie de faire

2
Kyle