apt-get error

Asked by micwarr

My first install attempt fot package hl5170dnlpr seemed to have failed. I believe it was a .deb file launched by double-clicking on the file's icon

Below is the error when attempting to install again, using apt-get:

> apt-get install hl5170dnlpr
Reading package lists... Done
Building dependency tree... Done
hl5170dnlpr is already the newest version.
The following packages will be REMOVED:
  hl5170dnlpr
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 82108 files and directories currently installed.)
Removing hl5170dnlpr ...
/var/lib/dpkg/info/hl5170dnlpr.postrm: line 3: /etc/init.d/lpd: is a directory
dpkg: error processing hl5170dnlpr (--remove):
 subprocess post-removal script returned error exit status 126
Errors were encountered while processing:
 hl5170dnlpr
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here's the output from dpkg --configure

> dpkg --configure hl5170dnlpr
dpkg: error processing hl5170dnlpr (--configure):
 package hl5170dnlpr is not ready for configuration
 cannot configure (current status `half-installed')
Errors were encountered while processing:
 hl5170dnlpr

Any ideas or suggestions?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Ralph Janke
Solved:
Last query:
Last reply:
Revision history for this message
Best Ralph Janke (txwikinger) said :
#1

There is a problem with the post removal script of the package.

The easiest way is probably to put a fake exit into the script. In the file

/var/lib/dpkg/info/hl5170dnlpr.postrm

add a new line at the beginning of the script:

exit 0

Then run the removal command

sudo apt-get remove hl5170dnlpr

Then you can try to install the package again

However, there is a small warning. You might have residue of the package left, since the removal script does not run.

Revision history for this message
micwarr (micwarr) said :
#2

Symptoms solved by following suggested advice -- thanks!

The script (i.e., /var/lib/dpkg/info/hl5170dnlpr.postrm) was very basic (see directly below)

#!/bin/sh
# ESP Package Manager v3.5.1
/etc/init.d/lpd restart

I suspect the underlying problem was that I didn't have lpd/lpr installed -- it's not showing as installed in Synaptic Package Manager