If you want to go from 32 to 64 bit Cygwin but keep all the packages[1], you might find yourself in a spot where you would like to export the list of cygwin packages and also be able to install cygwin with all these packages again. I will tell you how. Open your Cygwin shell and enter
cygcheck -c -d | sed -e "1,2d" -e 's/ .*\$//' > packagelist
This will simply dump a list of installed packages. To install Cygwin 64 with these packages selected, download setup-x86_64[2] and execute it with the command line parameters
./setup-x86_64 -P `awk 'NR==1{printf \$1}{printf ",%s", \$1}' packagelist`
I am not savvy with
awk,
so I foundtr
to work, too. Also, if the package list is short enough, the single comma-separated list of packages can be created on the source computer so destination computer does not need a pre-installed bare-bones Cygwin in order to assemble such a list:This needs to be modified into a
*.cmd
file by prefixing the single-line comma-separated list with.\setup-x86_64.exe -P
.Just be aware that if you copy the file to a
*.cmd
file before prefixing the line, Windows 10 will "protect" you from running the file (even though you may select Edit from the context menu). You need to open Notepad first, then load the file.