I am using MXLinux based on Debian 12 (Bookworm)
I did sudo apt install android-*
I got this error at the end of the output:
Errors were encountered while processing:
android-androresolvd
E: Sub-process /usr/bin/dpkg returned an error code (1)
I am trying to remove that package sudo apt purge android-androresolvd
but getting an error
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
android-androresolvd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 37.9 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 407686 files and directories currently installed.)
Removing android-androresolvd (1.3-1+b1) ...
invoke-rc.d: initscript android-androresolvd, action "stop" failed.
dpkg: error processing package android-androresolvd (--remove):
installed android-androresolvd package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
android-androresolvd
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
2
Answers
(Thanks to ChatGPT)
Bypassing the Pre-Removal Script by manually modifying the failing script to allow the removal process to proceed.
Locate the Script:
sudo nano /var/lib/dpkg/info/android-androresolvd.prerm
Comment Out the Contents: Add a # at the beginning of every line in the script to effectively disable it, or replace its contents with:
sudo dpkg --remove android-androresolvd
Error were encountered while processing:
android – androresolv
E: Sub – process /usr/bin/dpkg returned an error code (1)
用户尝试使用sudo apt purge android – androresolv命令来卸载软件包,但也遇到了错误。
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following packages will be REMOVED:
android – androresolv
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 37.9 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database… 409686 files and directories currently installed.)
Removing android – androresolv (1.3 – 1+b1)…
invoke – rc.d: initscript android – androresolv, action "stop" failed.
dpkg: error processing package android – androresolv (–remove):
installed android – androresolv package pre – removal script subprocess returned error exit status 1
Errors were encountered while processing:
android – androresolv
E: Sub – process /usr/bin/dpkg returned an error code (1)