Question: What is this error all about? "rm: remove write-protected directory '/var/lib/docker'?" when I tried to remove /var/lib/docker with command below:
sudo rm -R /var/lib/docker
Answer: use the following command to force the directory to be removed,
sudo rm -rf /var/lib/dokcer
This should do it. Keep in mind that "r" is for "recursive", it will iterate through the files and remove them and "f" stands for "force" which will force the command to run.
[Note]: It is always not a good idea to force command, the error is telling you something that you have to pay attention to, before your force the command be aware what you might be losing.
The error is not your enemy but your best friend.
Hope this helps.