Error on lock file on apt update solved

Thought others may benefit from my mistake.

Error message output:

E: Could not get lock /var/lib/apt/lists/lock. It is held by process 1466 (packagekitd)
N: Be aware that removing the lock is not a solution and may break your system.
E: Unable to unlock directory /var/lib/apt/lists/

This error occurred on both my L5 and L11 when entering “sudo apt update

The thing I changed on BOTH my L5 and L11 was how I shutdown.

Previously I was using “sudo shutdown -P --poweroff

But recently changed to using “sudo shutdown -now” which was quicker to shutdown. Then the error occurred.

But my BAD on not checking docs? Especially since it took less time - I should have thought what steps on shutdown were left out to more quickly complete the task.

Solution:
I shutdown both the L5 and L11 using “sudo shutdown -P --poweroff” and then on power up was successfully able to “sudo apt update” and “sudo apt full-upgrade

Note: the battery in the L5 had discharged from 50% to 1% :scream: over several months of non-use and I suspect this also had something to do with difference in shutdown options. Different shutdown states leading to differing power usage? I have not checked the docs nor tested this theory.

1 Like