35

I have an issue with the package openqrm.

How do I remove it?

root@wl183004:/# 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)

root@wl183004:/# 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)

root@wl183004:/# 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)
root@wl183004:/# 
2

5 Answers 5

30

You might try to upgrade the package before purging it. In some cases, the new package will fix the removal script (dpkg is made so that new packages can fix even the transition scripts of old packages).

If that doesn't work, have a look at /var/lib/dpkg/info/openqrm.postinst like Kyle suggested, locate the line that fails, comment it out and try to purge again. Repeat until success.

5
  • 4
    I've added exit 0 to the begining of openqrm.prerm. it worked. thanks
    – Marc Riera
    Sep 13, 2010 at 17:02
  • 1
    but... how do we do this? "locate the line that fails, comment it out"
    – ahnbizcad
    May 2, 2015 at 1:55
  • Using your favorite editor and sudo
    – raphink
    May 2, 2015 at 11:05
  • 1
    add set -x to the script to see where it fails, cf. cyberciti.biz/tips/debugging-shell-script.html
    – Maxime R.
    Oct 11, 2016 at 17:26
  • 1
    I've also had to edit a /var/lib/dpkg/info/*.prerm file to get a package to uninstall. What a design!
    – chicks
    Apr 8, 2018 at 16:28
24

The following worked for me:

  • 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
2
  • 2
    this worked! Generalized, simply replace "openqrm" with whatever your package name is.
    – ahnbizcad
    May 2, 2015 at 2:03
  • This helped me to get rid of a broken apacheds install, that blocked totally any apt command on my system, thanks... we could generalize a little bit more by searching first all the locations of the package with sudo find / | grep [package name], then removing them all, then using sudo apt-get remove [package name] -purge --auto-remove (not scriptedly, some of the results might not be to be removed though...)
    – cedbeu
    Sep 29, 2018 at 2:49
7

Just try to touch the missing file. If this is just one file missing file it could be a great workaround.

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

Now try to remove the package with apt-get or aptitude.

1
  • This worked - was finally able to remove postfix Sep 14, 2013 at 20:15
3

Look at /var/lib/dpkg/info/openqrm.postinst and see what it's trying to do

-1

There's a post here about the same kind of error (different package, though). Have you tried dpkg --force-all yet?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .