0

I have recently installed apcupsd package from my system and then decided to remove it. When I try to remove it it fails.Below is some info:

> uname -a Linux 3.5.0-26-generic #42~precise1-Ubuntu SMP Mon
> Mar 11 22:17:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
> 
> sudo apt-get -f install apcupsd Reading package lists... Done Building
> dependency tree        Reading state information... Done apcupsd is
> already the newest version. 0 upgraded, 0 newly installed, 0 to remove
> and 7 not upgraded. 1 not fully installed or removed. Need to get 0
> B/281 kB of archives. After this operation, 0 B of additional disk
> space will be used. Do you want to continue [Y/n]?
> 
> (Reading database ... 454090 files and directories currently
> installed.) Preparing to replace apcupsd 3.14.10-1 (using
> .../apcupsd_3.14.10-1_amd64.deb) ... Unpacking replacement apcupsd ...
> invoke-rc.d: unknown initscript, /etc/init.d/apcupsd not found. cat:
> /var/lib/acpi-support/system-manufacturer: No such file or directory
> cat: /var/lib/acpi-support/system-product-name: No such file or
> directory cat: /var/lib/acpi-support/system-version: No such file or
> directory cat: /var/lib/acpi-support/bios-version: No such file or
> directory dpkg: warning: subprocess old post-removal script returned
> error exit status 1 dpkg - trying script from the new package instead
> ... invoke-rc.d: unknown initscript, /etc/init.d/apcupsd not found.
> cat: /var/lib/acpi-support/system-manufacturer: No such file or
> directory cat: /var/lib/acpi-support/system-product-name: No such file
> or directory cat: /var/lib/acpi-support/system-version: No such file
> or directory cat: /var/lib/acpi-support/bios-version: No such file or
> directory dpkg: error processing
> /var/cache/apt/archives/apcupsd_3.14.10-1_amd64.deb (--unpack): 
> subprocess new post-removal script returned error exit status 1
> invoke-rc.d: unknown initscript, /etc/init.d/apcupsd not found. cat:
> /var/lib/acpi-support/system-manufacturer: No such file or directory
> cat: /var/lib/acpi-support/system-product-name: No such file or
> directory cat: /var/lib/acpi-support/system-version: No such file or
> directory cat: /var/lib/acpi-support/bios-version: No such file or
> directory dpkg: error while cleaning up:  subprocess new post-removal
> script returned error exit status 1 Processing triggers for ureadahead
> ... Processing triggers for man-db ... Errors were encountered while
> processing:  /var/cache/apt/archives/apcupsd_3.14.10-1_amd64.deb E:
> Sub-process /usr/bin/dpkg returned an error code (1)
> 


> sudo apt-get remove apcupsd Reading package lists... Done Building
> dependency tree        Reading state information... Done The following
> packages will be REMOVED:   apcupsd 0 upgraded, 0 newly installed, 1
> to remove and 7 not upgraded. 1 not fully installed or removed. After
> this operation, 749 kB disk space will be freed. Do you want to
> continue [Y/n]?  dpkg: error processing apcupsd (--remove):  Package
> is in a very bad inconsistent state - you should  reinstall it before
> attempting a removal. Errors were encountered while processing: 
> apcupsd E: Sub-process /usr/bin/dpkg returned an error code (1)

Can somebody help please?

Thank you Yannis


I have tried everything and for some reason it does not uninstall!

sudo apt-get --reinstall install apcupsd
Reading package lists... Done
Building dependency tree       
Reading state information... Done

0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
17 not fully installed or removed.
Need to get 0 B/281 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 454211 files and directories currently installed.)
Preparing to replace apcupsd 3.14.10-1 (using .../apcupsd_3.14.10-1_amd64.deb) ...
Unpacking replacement apcupsd ...
invoke-rc.d: unknown initscript, /etc/init.d/apcupsd not found.
cat: /var/lib/acpi-support/system-manufacturer: No such file or directory
cat: /var/lib/acpi-support/system-product-name: No such file or directory
cat: /var/lib/acpi-support/system-version: No such file or directory
cat: /var/lib/acpi-support/bios-version: No such file or directory
dpkg: warning: subprocess old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
invoke-rc.d: unknown initscript, /etc/init.d/apcupsd not found.
cat: /var/lib/acpi-support/system-manufacturer: No such file or directory
cat: /var/lib/acpi-support/system-product-name: No such file or directory
cat: /var/lib/acpi-support/system-version: No such file or directory
cat: /var/lib/acpi-support/bios-version: No such file or directory
dpkg: error processing /var/cache/apt/archives/apcupsd_3.14.10-1_amd64.deb (--unpack):
 subprocess new post-removal script returned error exit status 1
invoke-rc.d: unknown initscript, /etc/init.d/apcupsd not found.
cat: /var/lib/acpi-support/system-manufacturer: No such file or directory
cat: /var/lib/acpi-support/system-product-name: No such file or directory
cat: /var/lib/acpi-support/system-version: No such file or directory
cat: /var/lib/acpi-support/bios-version: No such file or directory
dpkg: error while cleaning up:
 subprocess new post-removal script returned error exit status 1
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/apcupsd_3.14.10-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt-get remove apcupsd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  apcupsd
0 upgraded, 0 newly installed, 1 to remove and 7 not upgraded.
17 not fully installed or removed.
After this operation, 749 kB disk space will be freed.
Do you want to continue [Y/n]? 
dpkg: error processing apcupsd (--remove):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 apcupsd
E: Sub-process /usr/bin/dpkg returned an error code (1)

2 Answers 2

1

I could read a bit of that, and the best solution is reinstalling the package as it says apt-get at the very end, then uninstall it:

sudo apt-get --reinstall install apcupsd
sudo apt-get remove apcupsd

That should solve your problem.

0
0

Ok finally I managed to fix it by:

  1. Manually removing apcupsd entries from /var/lib/dpkg/status file.
  2. Manually removing apcupsd program folders.

Hope it helps someone.

Cheers!

You must log in to answer this question.

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