rm: remove write-protected directory '/var/lib/docker'?

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.

Edit this Article
remove docker directory uninstall docker from Linux Docker Docker-Compose Docker published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy