删除 Cygwin 包文件而不丢失有关已安装内容的详细信息?

Remove Cygwin package files without losing details about what's installed?

网上研究表明,可以删除Cygwin包文件来保存space。在 Cygwin 安装文件夹中,我有一个反映镜像站点的子文件夹(比如)http%3a%2f%2fcygwin.mirror.constant.com%2f。文件 http%3a%2f%2fcygwin.mirror.constant.com%2f/x86_64/setup.ini 似乎包含有关已安装软件包的所有信息。唯一的其他 folders/files 在以下两个文件夹树中:

http%3a%2f%2fcygwin.mirror.constant.com%2f/noarch/release/*
http%3a%2f%2fcygwin.mirror.constant.com%2f/x86_64/release/*

我能否删除 http%3a%2f%2fcygwin.mirror.constant.com%2f 文件夹树中除 http%3a%2f%2fcygwin.mirror.constant.com%2f/x86_64/setup.ini 之外的所有内容,并且仍然让安装程序知道我安装了什么、需要更新什么以及需要下载什么才能重新安装?

安装包信息保存在

/etc/setup/installed.db

缓存在http%3a%2f%2fcygwin.mirror.constant.com%2f 仅在安装或重新安装任何软件包时需要。

查看 Cygwin User Guide
中的信息 https://cygwin.com/cygwin-ug-net/setup-net.html#setup-localdir

After installing Cygwin, the cache is no longer necessary, but you may want to retain the packages as backups, for installing Cygwin to another system, or in case you need to reinstall a package.