Fix 'Could not get lock /var/lib/dpkg/lock' Error on Ubuntu/Debian - UFW Port Range Not Working: Troubleshooting Guide-Troubleshooting UFW Firewall Port Blocked

Result check
- Keep one change per test run so you know which step helped.
- Undo temporary changes after the issue is confirmed.