Skip to content

Instantly share code, notes, and snippets.

@zuhairkareem
Last active May 16, 2022 12:16
Show Gist options
  • Save zuhairkareem/3f257c3dbf0a0699f429cee9cdb3be92 to your computer and use it in GitHub Desktop.
Save zuhairkareem/3f257c3dbf0a0699f429cee9cdb3be92 to your computer and use it in GitHub Desktop.
invoke-rc.d: policy-rc.d denied execution of stop. , dpkg: error processing package mysql-server-8.0 error on Ubuntu 20.04

For forcefully purging the package.

Since removing packages can be destructive, print the list of the package that will be removed:

dpkg -l | awk  '{print $2}' | grep -i mysql | grep -v lib

Check if any important package is being removed. If everything seems fine, proceed to step 2.

Purge the packages:

sudo dpkg -P  --force-all $(dpkg -l | awk  '{print $2}' | grep -i mysql | grep -v lib)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment