1. Check drive C. Cygwin is already installed at C:\cygwin64. See Figure 1.

2. Find Cygwin64 Terminal in the navigation, right-click and select Uninstall. See Figure 2.

3. Search Programs and Features for “cygwin”; the result is empty. See Figure 3.

4. Locate the previous installer at D:\Soft\setup-x86_64.exe. See Figure 4.

5. Select the first option, Install from Internet (downloaded files will be kept for future use). If you have previously downloaded the files and kept them, it is recommended to select the third option, Install from Local Directory. See Figure 5.

6. Select the directory where Cygwin was previously installed. The default is C:\cygwin64, so no changes are needed. See Figure 6.

7. Select the local package directory. Change it to D:\Soft\Cygwin. See Figure 7.

8. Progress. This page shows the download or installation progress. Error: Internal Error: gcrypt library error 1 unsupported pk alg. See Figure 8.

9. I decided to download the latest version of the installer: http://www.cygwin.com/setup-x86_64.exe . Then I repeated the above steps. The latest version of the installer did not throw any errors and successfully entered the Select Packages interface. See Figure 9.

10. In the View drop-down list, select Category, then in the New column of the All row, select Uninstall. Click Next. See Figure 10.

11. Uninstallation completed. See Figure 11.

12. However, I found that the installation directory C:\cygwin64 still exists. See Figure 12.

13. I decided to uninstall again. Uncheck Hide obsolete packages. This will show obsolete packages. Repeat step 10. See Figure 13.

14. On the Resolving Dependencies page, uncheck Accept default problem solutions. This means rejecting the default problem solutions. Uninstall everything. See Figure 14.

15. If you continue, some packages may not work properly. Are you sure you want to continue (not recommended)? Yes. See Figure 15.

16. However, I found that the installation directory C:\cygwin64 still exists, although the directory size has decreased. See Figure 16.

17. Create a new file: uninstall.bat, with the following content.
SET DIRECTORY_NAME="C:\cygwin64"
C:\Windows\System32\takeown /f %DIRECTORY_NAME% /r /d y
C:\Windows\System32\icacls %DIRECTORY_NAME% /grant administrators:F /t
PAUSE
18. After running it successfully, I found that the installation directory C:\cygwin64 still exists. This was not as expected. See Figure 17.

E:\Develop\2020\0807 - 在 Windows 10 64 位中卸载 Cygwin>SET DIRECTORY_NAME="C:\cygwin64"
E:\Develop\2020\0807 - 在 Windows 10 64 位中卸载 Cygwin>C:\windows\system32\TAKEOWN /f "C:\cygwin64" /r /d y
成功: 此文件(或文件夹): "C:\cygwin64" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\Cygwin-Terminal.ico" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\Cygwin.bat" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\Cygwin.ico" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\dev" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\lib" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\tmp" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\var" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\dev\fd" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\dev\mqueue" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\dev\shm" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\dev\stderr" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\dev\stdin" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\dev\stdout" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\bash_completion.d" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\fstab" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\fstab.d" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\hosts" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\mtab" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\networks" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\nsswitch.conf" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\pki" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\preremove" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\profile.d" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\protocols" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\rebase.db.x86_64" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\services" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\setup" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\skel" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\pki\ca-trust" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\pki\ca-trust\source" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\pki\ca-trust\source\ca-bundle.legacy.crt" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\000-cygwin-post-install.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\base-files-mketc.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\base-files-profile.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\bash.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\ca-certificates.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\coreutils.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有 。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\man-db.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\postinstall\mintty.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\preremove\base-files.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\preremove\ca-certificates.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\preremove\coreutils.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\preremove\man-db.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\preremove\_autorebase.sh.done" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有 。
成功: 此文件(或文件夹): "C:\cygwin64\etc\setup\installed.db" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\setup\setup.rc" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\etc\setup\timestamp" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home\Administrator" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home\Administrator\.bashrc" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home\Administrator\.bash_history" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home\Administrator\.bash_profile" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home\Administrator\.inputrc" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home\Administrator\.minttyrc" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\home\Administrator\.profile" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\lib\groff" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\lib\groff\groff_opts_with_arg.txt" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有 。
成功: 此文件(或文件夹): "C:\cygwin64\usr\local" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\src" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\tmp" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\local\bin" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\local\etc" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\local\lib" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\doc" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\info" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\doc\man-db" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\doc\xz" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\doc\man-db\man-db-manual.txt" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\doc\xz\faq.txt" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\info\.stamp" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\usr\share\info\dir" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\var\log" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\var\run" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\var\tmp" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\var\log\setup.log" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\var\log\setup.log.full" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
成功: 此文件(或文件夹): "C:\cygwin64\var\run\utmp" 现在由用户 "LAPTOP-9S1INV5O\Administrator" 所有。
E:\Develop\2020\0807 - 在 Windows 10 64 位中卸载 Cygwin>C:\windows\system32\ICACLS "C:\cygwin64" /grant administrators:F /t
已处理的文件: C:\cygwin64
已处理的文件: C:\cygwin64\Cygwin-Terminal.ico
已处理的文件: C:\cygwin64\Cygwin.bat
已处理的文件: C:\cygwin64\Cygwin.ico
已处理的文件: C:\cygwin64\dev
已处理的文件: C:\cygwin64\etc
已处理的文件: C:\cygwin64\home
已处理的文件: C:\cygwin64\lib
已处理的文件: C:\cygwin64\tmp
已处理的文件: C:\cygwin64\usr
已处理的文件: C:\cygwin64\var
已处理的文件: C:\cygwin64\dev\fd
已处理的文件: C:\cygwin64\dev\mqueue
已处理的文件: C:\cygwin64\dev\shm
已处理的文件: C:\cygwin64\dev\stderr
已处理的文件: C:\cygwin64\dev\stdin
已处理的文件: C:\cygwin64\dev\stdout
已处理的文件: C:\cygwin64\etc\bash_completion.d
已处理的文件: C:\cygwin64\etc\fstab
已处理的文件: C:\cygwin64\etc\fstab.d
已处理的文件: C:\cygwin64\etc\hosts
已处理的文件: C:\cygwin64\etc\mtab
已处理的文件: C:\cygwin64\etc\networks
已处理的文件: C:\cygwin64\etc\nsswitch.conf
已处理的文件: C:\cygwin64\etc\pki
已处理的文件: C:\cygwin64\etc\postinstall
已处理的文件: C:\cygwin64\etc\preremove
已处理的文件: C:\cygwin64\etc\profile.d
已处理的文件: C:\cygwin64\etc\protocols
已处理的文件: C:\cygwin64\etc\rebase.db.x86_64
已处理的文件: C:\cygwin64\etc\services
已处理的文件: C:\cygwin64\etc\setup
已处理的文件: C:\cygwin64\etc\skel
已处理的文件: C:\cygwin64\etc\pki\ca-trust
已处理的文件: C:\cygwin64\etc\pki\ca-trust\source
已处理的文件: C:\cygwin64\etc\pki\ca-trust\source\ca-bundle.legacy.crt
已处理的文件: C:\cygwin64\etc\postinstall\000-cygwin-post-install.sh.done
已处理的文件: C:\cygwin64\etc\postinstall\base-files-mketc.sh.done
已处理的文件: C:\cygwin64\etc\postinstall\base-files-profile.sh.done
已处理的文件: C:\cygwin64\etc\postinstall\bash.sh.done
已处理的文件: C:\cygwin64\etc\postinstall\ca-certificates.sh.done
已处理的文件: C:\cygwin64\etc\postinstall\coreutils.sh.done
已处理的文件: C:\cygwin64\etc\postinstall\man-db.sh.done
已处理的文件: C:\cygwin64\etc\postinstall\mintty.sh.done
已处理的文件: C:\cygwin64\etc\preremove\base-files.sh.done
已处理的文件: C:\cygwin64\etc\preremove\ca-certificates.sh.done
已处理的文件: C:\cygwin64\etc\preremove\coreutils.sh.done
已处理的文件: C:\cygwin64\etc\preremove\man-db.sh.done
已处理的文件: C:\cygwin64\etc\preremove\_autorebase.sh.done
已处理的文件: C:\cygwin64\etc\setup\installed.db
已处理的文件: C:\cygwin64\etc\setup\setup.rc
已处理的文件: C:\cygwin64\etc\setup\timestamp
已处理的文件: C:\cygwin64\home\Administrator
已处理的文件: C:\cygwin64\home\Administrator\.bashrc
已处理的文件: C:\cygwin64\home\Administrator\.bash_history
已处理的文件: C:\cygwin64\home\Administrator\.bash_profile
已处理的文件: C:\cygwin64\home\Administrator\.inputrc
已处理的文件: C:\cygwin64\home\Administrator\.minttyrc
已处理的文件: C:\cygwin64\home\Administrator\.profile
已处理的文件: C:\cygwin64\lib\groff
已处理的文件: C:\cygwin64\lib\groff\groff_opts_with_arg.txt
已处理的文件: C:\cygwin64\usr\local
已处理的文件: C:\cygwin64\usr\share
已处理的文件: C:\cygwin64\usr\src
已处理的文件: C:\cygwin64\usr\tmp
已处理的文件: C:\cygwin64\usr\local\bin
已处理的文件: C:\cygwin64\usr\local\etc
已处理的文件: C:\cygwin64\usr\local\lib
已处理的文件: C:\cygwin64\usr\share\doc
已处理的文件: C:\cygwin64\usr\share\info
已处理的文件: C:\cygwin64\usr\share\doc\man-db
已处理的文件: C:\cygwin64\usr\share\doc\xz
已处理的文件: C:\cygwin64\usr\share\doc\man-db\man-db-manual.txt
已处理的文件: C:\cygwin64\usr\share\doc\xz\faq.txt
已处理的文件: C:\cygwin64\usr\share\info\.stamp
已处理的文件: C:\cygwin64\usr\share\info\dir
已处理的文件: C:\cygwin64\var\log
已处理的文件: C:\cygwin64\var\run
已处理的文件: C:\cygwin64\var\tmp
已处理的文件: C:\cygwin64\var\log\setup.log
已处理的文件: C:\cygwin64\var\log\setup.log.full
已处理的文件: C:\cygwin64\var\run\utmp
已成功处理 82 个文件; 处理 0 个文件时失败
E:\Develop\2020\0807 - 在 Windows 10 64 位中卸载 Cygwin>PAUSE
请按任意键继续. . .
19. Use Shift + Delete to force delete the installation directory C:\cygwin64. Do this for all current items. Yes. The deletion was successful. See Figure 19.

20. Cygwin – Cygwin64 Terminal still exists in the Start menu. See Figure 20.

21. Press Win + R to open the Run dialog, type regedit, and press Enter to open the Registry. HKEY_CURRENT_USER\Software\Cygwin needs to be deleted. See Figure 21.

22. Cygwin – Cygwin64 Terminal still exists in the Start menu. Right-click – More – Open file location. See Figure 22.

23. File: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cygwin\Cygwin64 Terminal. Delete the directory: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cygwin. See Figure 23.

24. Cygwin – Cygwin64 Terminal no longer exists in the Start menu. See Figure 24.

25. Search the registry for “Cygwin”; there are no results. At this point, Cygwin has been completely uninstalled from Windows 10 64-bit. See Figure 25.

