Method 1 ps aux | grep -i apt sudo kill -9 <process_id> Method 2 sudo lsof /var/lib/dpkg/lock sudo lsof /var/lib/apt/lists/lock sudo lsof /var/cache/apt/archives/lock sudo kill -9 <process_id>