How to: Uninstall Cygwin on Windows

Uninstalling software can be quite difficult on Windows, especially if you uninstall software which can’t be uninstalled simply by using the wizard or the uninstall utility. Some tools don’t provide these options and they need to be removed manually. This can be quite difficult at certain occasions, especially if you really need to remove the file as soon as possible if it’s infected with malicious software.

If the program you need to uninstall does not show up in Control Panel >> Programs and Features nor in the Settings >> Apps, you might need to find a different approach to the issue.

Uninstalling Cygwin

Cygwin is quite a popular tool used by some more advanced users and the software was released way back in 1995. It allowed its users to run Linux and UNIX applications within a UNIX-like interface, making it easier for them to test them out on a Windows PC.  It’s an open source tool and it’s currently being maintained by Red Hat employees and various volunteers.

Cygwin’s interface

The real issue regarding this program is the fact that there is no way to uninstall it by any conventional means and you will have to perform some advanced operations in order to get rid of it.

Solution 1: Using Command Prompt

The real problem regarding the uninstallation of Cygwin is the fact that users often get the “permission denied” message when they try to delete Cygwin files and folders. We will avoid this problem. Using Command Prompt feels somewhat unsafe to inexperienced users but this is definitely one of the best ways to go because it’s rather easy to copy the following instructions and get the job done in no time.

  1. Stop any Cygwin services from running before you begin working on anything. Use the instructions located on their official FAQ to remove the services still running. The usual installed services are: sshd, cron, cygserver, inetd, apache, postgresql.
  2. If there are come Cygwin processes running in the background, terminate them using Windows Task Manager.
  3. Search for “cmd” or “Command Prompt”, right-click on it, and select Run as administrator.
  4. Use the following command to gain ownership over the Cygwin folder in no time:

takeown /r /d y /f cygwin

  1. The next command is going to give everyone full access to the Cygwin folder so that you can delete it no matter which account you are using.

icacls cygwin /t /grant Everyone:F

  1. This last command is going to delete the entire folder along with all subfolders.

rmdir /s /q cygwin

  1. Delete everything that might have remained such as Start Menu and desktop shortcuts, etc.
  2. Delete everything in the Software\Cygwin folder in HKEY_LOCAL_MACHINE and HKEY-CURRENT-USER using regedit.

Solution 2: Deleting via Windows Explorer

The same process we described in Solution 1 can be done without the use of Command Prompt. However, a lot of users stumble upon the issue where they don’t receive permissions necessary to delete the Cygwin folder. Let’s find out how to resolve this.

  1. Repeat the steps 1 and 2 from Solution 1.
  2. Try deleting the folder where you installed Cygwin. If you manage to delete it immediately,:::::::::
  3. If you receive the “permission denied” message, you will need to add ownership off the folder to your account.
  4. If you are using Windows 10, right-click on the Cygwin folder and open Properties >> Security. Click on Advanced and you should see the “Owner:” on top with an account linked to it.

    Click on “Change” and select the account you want to become the owner of the folder. After you click “OK”, you should check the box next to the “”Replace owner on subcontainers and objects” message in order to gain ownership over files and folders in the Cygwin folder.

Additionally, you should set the Permissions to Full Control by clicking on “Add” while still in the Advanced settings. Click on Select a principle and choose the same account as you did for the Owner. Make sure this applies to subfolders and files inside as well.

  1. If you are using an older version of Windows or if Windows 10 won’t let you manage permissions, you will need to the same but after restarting Windows in Safe Mode.
  2. Continue with Steps 7 and 8 from Solution 1.
Kevin Arrows
Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Expert Tip

How to: Uninstall Cygwin on Windows

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested