1、查看 C 盘,Cygwin 已经安装,C:\cygwin64。如图1

图1

2、在导航中找到 Cygwin64 Terminal,右键 – 卸载。如图2

图2

3、搜索程序和功能:cygwin,结果为空。如图3

图3

4、找到之前的安装包,D:\Soft\setup-x86_64.exe。如图4

图4

5、选择第 1 项,从 Intemet 安装(下载的文件将保留以备将来使用)。如果之前有下载,且有保留,建议选择第 3 项,从本地目录安装。如图5

图5

6、选择 Cygwin 的之前安装的目录,默认为:C:\cygwin64,无需改动。如图6

图6

7、选择本地软件包目录。修改为:D:\Soft\Cygwin。如图7

图7

8、进展。该页面显示下载或安装的进度。报错:Internal Error: gcrypt library error 1 unsupported pk alg.。如图8

图8

9、决定下载最新版本的安装包:http://www.cygwin.com/setup-x86_64.exe 。然后再次重复上述步骤。最新版本的安装包,未再报错。成功进入 Select Packages 界面。如图9

图9

10、在 View 下拉列表中选择:Category,然后在 All 这一行的 New 列,选择 Uninstall。点击下一步。如图10

图10

11、卸载完成。如图11

图11

12、但是发现安装目录:C:\cygwin64 仍然存在。如图12

图12

13、决定再次卸载。取消勾选 Hide obsoleete packages。即显示已经过时的软件包。重复第 10 步骤。如图13

图13

14、在 Resolving Dependencies 页面中,取消勾选 Accept default problem solutions。即不接受默认问题解决方案。全部卸载。如图14

图14

15、如果继续,某些软件包可能无法正常工作。您确定要继续 (不推荐) 吗?确定。如图15

图15

16、但是发现安装目录:C:\cygwin64 仍然存在。虽然目录有所减少。如图16

图16

17、新建文件:uninstall.bat,内容如下。

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、运行成功后,发现安装目录:C:\cygwin64 仍然存在。不符合预期。如图17

图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、Shift + Delete 强制删除安装目录:C:\cygwin64。为所有当前项目执行此操作。是。彻底删除成功。如图19

图19

20、在系统菜单中仍然存在:Cygwin – Cygwin64 Terminal。如图20

图20

21、按 Win + R 打开运行,输入 regedit,按回车键,即可打开注册表。HKEY_CURRENT_USER\Software\Cygwin。需要删除。如图21

图21

22、在系统菜单中仍然存在:Cygwin – Cygwin64 Terminal。右键 – 更多 – 打开文件位置。如图22

图22

23、文件:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cygwin\Cygwin64 Terminal。删除目录:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cygwin。如图23

图23

24、在系统菜单中已不存在:Cygwin – Cygwin64 Terminal。如图24

图24

25、在注册表中查找:Cygwin,无结果。到此为止,在 Windows 10 64 位中已经彻底卸载 Cygwin。如图25

图25

 

永夜