In some cases the error is caused due to incomplete installation of any package or becasuse of broken pacakges. In some cases youo run multiple update request that can also cause the same error.
To Fix this error Follow these steps :
- rm /var/lib/apt/lists/lock
- rm /var/cache/apt/archives/lock
- rm /var/lib/dpkg/lock
You can aslo use this script to automate the process (the link is given below.)
Download script (GIT)
How to run:
- Download the script from above link.
- Make sure to run the script as root user.
- Rest it will do all the work and also update your system at the same time.
|Scrpt is running.|
Note: Please made the necessary changes if any according to your system.