Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1030  / 2 Years ago, thu, march 31, 2022, 4:18:14

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)

More From » apt

 Answers
1

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!


[#29772] Friday, April 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
;