Remember needing Cygwin back in the day, but after using it for my only occasion forgot the software-libraries completely? That happened to me. I have installed Windows 7 again and found my C:cygwin folder with all the files. Wanted to get rid of it, but no way – a mysterious “permission denied” when deleting the files. It seems there’s no way to remove it. Cygwin protects the files with some security stuff. That’s just idiotic, having no access to my own files!
I’m always logged in as native Administrator – no other users present. What I tried next was to navigate to that folder through my Linux machine (CIFS mounted filesystem), but got “permission denied” error there as well, even with the magic command:
sudo rm -rf /media/windows/cygwin
Here’s how to remove Cygwin once and for all.
You will need
- 2 minutes
Run cmd, navigate to C: (or another disk, if you have installed it in a different path).
This command takes ownership recursive of the folder, without asking anything:
takeown /r /d y /f cygwin
This command gives Full Access to Everyone recursively in the folder:
icacls cygwin /t /grant Everyone:F
And finally, the command which deletes it all and removes Cygwin:
rmdir /s /q cygwin
Good bye, Cygwin!
Thanks for reading! I need your attention for a moment.
Did your problem got solved? Did you enjoy this post? If so, consider thanking me on Patreon. Doing this is not free and I'd love you buy me a beer or coffee. If you do that, I might be able to help you if you didn't get your problem solved with this blog post. I know my shit around areas like website design, coding, blogging, digital marketing and SEO so if you want to do business with me in other ways let me know.