– Forcibly restarting or shutting down your computer while package management commands are executing.
dpkg --clear-avail erases the old information about what packages are available, forcing the system to build a fresh index when you run sudo apt update . Best Practices to Prevent dpkg Interruptions – Forcibly restarting or shutting down your computer
sudo rm /var/lib/dpkg/lock-frontend sudo rm /var/lib/dpkg/lock sudo rm /var/cache/apt/archives/lock Use code with caution. it's safe to remove lock files:
This command re-configures any packages that were partially installed or interrupted during a previous process. Troubleshooting Further Issues – Forcibly restarting or shutting down your computer
Look for 100% or >95% usage on / or /var . Clean temporary files:
If you see only the grep command itself, it's safe to remove lock files: