0

I can't do anything with apt-get. As root, I ran "apt-get clean" (finished quickly and silently). Then "apt-get update"- which, since I am running an old version (13.?) can't find the repositories and fails. It used to fail anyway because of this error, which happens when I try to install or remove a package:

After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 386770 files and directories currently installed.)
Removing brscan2 (0.2.5-1) ...
rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData/ALL’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData/AL’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane/models2’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother’: No such file or directory
dpkg: error processing package brscan2 (--remove):
 subprocess installed 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)

I have tried messing with "brscan2" manually, but haven't been able to fix this.

I am thinking of just putting in a 14.04 or 16.? lts CD and trying to upgrade. I bet that would fail too. So- what to do?

Thanks in advance,

Bill

Pilot6
  • 90,100
  • 91
  • 213
  • 324
lunix
  • 65

2 Answers2

1

Solution

I recreated the folders using:

 sudo mkdir -pv /usr/local/Brother/sane/models2
    mkdir: created directory '/usr/local/Brother'
    mkdir: created directory '/usr/local/Brother/sane'
    mkdir: created directory '/usr/local/Brother/sane/models2'`

sudo mkdir -pv /usr/local/Brother/sane/GrayCmData/ALL mkdir: created directory '/usr/local/Brother/sane/GrayCmData' mkdir: created directory '/usr/local/Brother/sane/GrayCmData/ALL'`

sudo mkdir -pv /usr/local/Brother/sane/GrayCmData/AL mkdir: created directory '/usr/local/Brother/sane/GrayCmData/AL'`

and then I could cleanly remove the package:

sudo dpkg -P brscan2

1

Please be more verbose - which command did you try?

You can try:

sudo apt-get -f install

and

sudo dpkg --configure -a

I would use comments if I was allowed to

cybea
  • 89
  • 5
  • Also, have you tried an apt-get clean followed by apt-get update ? – tudor -Reinstate Monica- Mar 29 '16 at 22:49
  • dpkg: error: unknown option --reconfigure – lunix Mar 30 '16 at 05:28
  • apt-get clean returns quickly and silently apt-get update fails the same as attempting to install something – lunix Mar 30 '16 at 05:29
  • sorry: I gave wrong option for dpkg command. Corrected above to dpkg --configure -a – cybea Mar 30 '16 at 20:37
  • Please can you paste complete output from apt-get update and apt-get install <some package>? – cybea Mar 30 '16 at 20:40
  • update can't find the old repositories (but failed when it could too). The output is WAAAY too long to post. It's 18K chars beyond the limit. – lunix Mar 30 '16 at 21:09
  • root@LEX:/home/bill# apt-get install pyrenamer After this operation, 0 B of additional disk space will be used. ... Removing brscan2 (0.2.5-1) ... rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData/ALL’: No such file or directory rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData/AL’: No such file or directory rmdir: failed to remove ‘/usr/local/Brother’: No such file or directory dpkg: error processing package brscan2 (--remove): subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing: brscan2 (edited for length) – lunix Mar 30 '16 at 21:13
  • "dpkg --configure -a" returns quickly and silently. – lunix Mar 30 '16 at 21:35
  • try sudo dpkg --purge --force-all brscan2 – cybea Mar 30 '16 at 21:59
  • (Reading database ... 386770 files and dir..s currently installed.) Removing brscan2 (0.2.5-1) ... rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData/ALL’: No such file or directory rmdir: failed to remove ‘/usr/local/Brother/sane/models2’: No such file or directory rmdir: failed to remove ‘/usr/local/Brother/sane’: No such file or directory rmdir: failed to remove ‘/usr/local/Brother’: No such file or directory dpkg: error processing package brscan2 (--purge): subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing: brscan2 – lunix Mar 31 '16 at 20:17
  • Should we move this to CHAT? That's what I am being prompted to do – lunix Mar 31 '16 at 20:17
  • sorry for huge delay - didnt realize - you couldnt see chat I think I can not help you much BUT
    • you didnt answer what happened with sudo apt-get -f install
    • I also found this: askubuntu.com/questions/… with more commands to try
    • it is hard to help if not getting complete error message - there is something like paste.ubuntu.com you can try
    – cybea Apr 05 '16 at 18:10
  • I mean this: https://askubuntu.com/questions/438345/how-to-remove-install-a-package-that-is-not-fully-installed – cybea Apr 05 '16 at 18:11