Linux Could not open lock file /var/lib/apt/lists/lock Permission denied

I have received following error when tried to run apt update command on Linux(Ubuntu) machine.

E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission ded) E: Unable to lock directory /var/lib/apt/lists/ W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13:rmission denied) W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches ( Permission denied)

Linux Could not open lock file varlibaptlistslock Permission denied

Solution:

Use sudo to run a command with root privileges, like so:

sudo apt-get update

or switch to root account and run the command.