Correcting Broken Packages

For these first two steps, many people have better results with ‘aptitude’ finding a resolution.This command may help, but it is not installed by default in Devuan. If you recall it and install it after the broken package situation is resolved, it is worth trying.*PACKAGEis meant to be a package name that is broken. Replace a package name when using the commands.

you may need to delete the lock files. Lock files are used to keep resources available for certain programs – it helps prevent other programs from accessing files at the same time. This can be done by simply deleting the lockfile list:

sudo rm /var/lib/apt/lists/lock

Step three:

sudo apt-get remove PACKAGE

It probably won’t be successful, but it is worth trying before removing it forcefully.

Depending on the errors you get when trying to remove the package normally, you might be able to identify the broken package using dpkg and grep:

dpkg -l | grep ^..r

This command lists all packages, then grep lists any results containing the ‘r’ flag in the third field, which means “reinst-required” (reinstall required). If the broken package shows up, you will be able to remove it.

Execute the following command to forcefully remove the package from your machine. Don’t forget to enter your password to authorize the deletion. Replace with the name of the broken package.