LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   synaptic won't complete unistall of package (https://www.linuxquestions.org/questions/debian-26/synaptic-wont-complete-unistall-of-package-517308/)

rbees 01-07-2007 08:56 PM

synaptic won't complete unistall of package
 
Thanks to all.

I can't get synaptic, kpakcage, apt-get, dpkg to complete the removal of the brscan2 package which is part of the drivers for a brother multi-function printer. It was installed using the instructions on the Brother site. I have not been able to get the printer to work, but that is in a different thread. This package removal is part of trying to solve that issue.

When I do # dpkg -purge brscan2, or synaptic,
aptitude, kpackage or,apt-get the uninstall runs ok but returns the error that it can't remove some files/folders because they don't exist.

I actually think this is a problem with the script in the package because the whole package management system is working fine for all other packages.

After any attempted removal of this brscan2 package, before I can do anything else, I have to reinstall the package, as per normal, before the system will go on to something else. Both synaptic and kpackage report the package size as 0 byts. :scratch: strange. In the installed state all the files from the package seam to be there in the file system. Even the ones that the unistall failuer says are not there.

I have looked and haven't found a posting on this problem. Others that are fixed by the typical reinstall and unistall. My question is that this:

After I do the uninstall w/purge can I just delete the entry in the /var/lib/dpkg/status file to this package?

I know this is not the recomended method, and I would rather use a more conventional method if one exists.

Debian Etch (mostly upto date as of yesterday)
kernel 2.6.16-2-k7

Thanks to the may people who will read this for there help.

David the H. 01-07-2007 11:33 PM

Yes, some uninstall scripts seem to be a bit brain-dead when it comes to missing files. Probably there have been changes in the file locations, and the uninstall scripts were not updated correctly, so you have situations where the scripts try to remove something that isn't there anymore.

In these situations you can usually simply use the 'touch' command to create dummy substitutes for the missing files and rerun the uninstall. This generally lets it finish properly. It probably won't work if the script is trying to remove the same file twice or something though.

Apt-get also has a '--force-yes' option that might make it ignore the missing files. I've never tried using it for removal though, so I'm not absolutely sure.

rbees 01-08-2007 05:41 AM

same results
 
Thanks Dave the H

I still get the same results when I use the --force option. I am posting the results below. (as aside How do I get the output to be in one of those neat scroll boxes I see some times?)

# apt-get --purge remove --force-yes brscan2
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED
brscan2
0 upgraded, 0 newly installed, 1 to remove and 73 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 ... 161584 files and directories currently installed.)
Removing brscan2 ...
rmdir: /usr/local/Brother/sane/GrayCmData/ALL: No such file or directory
rmdir: /usr/local/Brother/sane/GrayCmData/AL: No such file or directory
rmdir: /usr/local/Brother/sane/GrayCmData: No such file or directory
rmdir: /usr/local/Brother/sane: No such file or directory
dpkg: error processing brscan2 (--remove):
subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
brscan2
E: Sub-process /usr/bin/dpkg returned an error code (1)
#

The out put seams to me to be indicating that the script is trying to remove those folders twice. Yes they do exist when the package is in the installed state. I haven't tried to make a couple of dummy folders an rerunning the script yet. Also I am not familiar with "touch", but making the dummy folders through Konqueror as root should serve the same purpose I suppose.

What if I put an extra read only file in the folder that is not normally there. I have seen that cause the uninstall complete but leave the folder behind for manual removal. Think I will try that first.

Thanks for listening to me ramble on. Sometimes that is the best help.

rbees 01-08-2007 06:02 AM

success
 
Once again a big thanks to all. :) ;) :D

I put an extra text file in both folders and the uninstall script ran to completion. Then all I had to do was manually remove the files and folders. Now I have a couple of symlinks to get rid of and I can start to reinstall the whole driver package for this printer.

Thanks

heyubob 04-04-2007 12:43 PM

Thanks, it worked for me too!
 
Will this technique work for other troubled packages? Could somebody explain the pitfalls of doing this.

Thank you.

rbees 04-04-2007 04:17 PM

Heyubob,

The only thing I know about is if the script is failing for someother reason. In that case who knows what may happen. Looking at the script should help reveal any potential problems.


All times are GMT -5. The time now is 12:00 AM.