Could not get lock /var/lib/dpkg/lock-frontend.

Root Cause

This locking is done so that the two processes do not change the content at the same time because this can result in unwarranted situations and possible system damage. To check the service running, use the following command.

$ ps aux | grep -i apt

Solution

We can kill the running process to solve the locking.

$ kill -9 <procces_id> (448168)