clean up a failed installation

Asked by Bruce Sorrows

I tried to install printer drivers in ubuntu 7.10 and it failed. Now everytime I add or remove programs I get an error message related to the failed installation of the printer drivers. I tried to find an answer but I could not. Would appreciate any help. I did find a sudo command which I think contains the information needed to fix my problem but I do not have any experience in linux and its commands:

bruce@spare:~$ sudo apt-get --fix-broken 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.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up hl1440lpr (1.1.2-1) ...
mkdir: cannot create directory `/var/spool/lpd/HL1440': No such file or director y
chown: cannot access `/var/spool/lpd/HL1440': No such file or directory
chgrp: cannot access `/var/spool/lpd/HL1440': No such file or directory
chmod: cannot access `/var/spool/lpd/HL1440': No such file or directory
/var/lib/dpkg/info/hl1440lpr.postinst: 4: /etc/init.d/lpd: not found
dpkg: error processing hl1440lpr (--configure):
 subprocess post-installation script returned error exit status 127
Errors were encountered while processing:
 hl1440lpr
E: Sub-process /usr/bin/dpkg returned an error code (1)
bruce@spare:~$

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Koen
Solved:
Last query:
Last reply:
Revision history for this message
Koen (koen-beek) said :
#1

try to do a

sudo apt-get purge hl1440lpr

this will hopefully remove the package that installed incorrectly and is now in an incorrect state

you can then try to reinstall it

sudo apt-get install hl1440lpr

Revision history for this message
Bruce Sorrows (bsorrows) said :
#2

Don't think it worked but I appreciate it here is the results:

bruce@spare:~$ sudo apt-get purge hl1440lpr
[sudo] password for bruce:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  hl1440lpr*
0 upgraded, 0 newly installed, 1 to remove and 0 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 ... 94385 files and directories currently installed.)
Removing hl1440lpr ...
/var/lib/dpkg/info/hl1440lpr.postrm: 3: /etc/init.d/lpd: not found
dpkg: error processing hl1440lpr (--purge):
 subprocess post-removal script returned error exit status 127
Errors were encountered while processing:
 hl1440lpr
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Marco Rodrigues (gothicx) said :
#3

Try: $ sudo apt-get purge --force hl1440lpr

Revision history for this message
Bruce Sorrows (bsorrows) said :
#4

Tried it this is what I get now:

bruce@spare:~$ sudo apt-get purge --force hl1440lpr
[sudo] password for bruce:
E: Command line option --force is not understood
bruce@spare:~$ sudo apt-get purge--force hl1440lpr
E: Invalid operation purge--force
bruce@spare:~$

Revision history for this message
Koen (koen-beek) said :
#5

The removal of the package seems to try to delete a /etc/init.d/lpd file which does not exist

I'd suggest trying to create an empty file with that name and then retrying the purge

sudo touch /etc/init.d/lpd
sudo apt-get purge hl1440lpr

Revision history for this message
Best Koen (koen-beek) said :
#6

I just downloaded the package from the brother website

the postrm script does the following :

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

so I'd suggest doing the following (if ls -l /etc/init.d/lpd says No such file or directory before doing all this !)

echo "echo" | sudo tee -a /etc/init.d/lpd
sudo chmod 777 /etc/init.d/lpd
sudo apt-get purge hl1440lpr
sudo rm /etc/init.d/lpd

Revision history for this message
Koen (koen-beek) said :
#7

this may also be useful (although it is old) : http://ubuntuforums.org/showthread.php?p=1111025

Revision history for this message
Bruce Sorrows (bsorrows) said :
#8

Thanks Koen Beek, that solved my question.

Revision history for this message
Bruce Sorrows (bsorrows) said :
#9

Thank you much! First post did not do it. Second suggestion did!