Automating Cygwin Installation
Source: This Wiki Page
The Cygwin Setup program is designed to be interactive, but there are
a few different ways to automate it. If you are deploying to multiple
systems, the best way is to run through a full installation once,
saving the entire downloaded package tree. Then, on target systems,
run setup.exe as a "Local Install" pointed at your downloaded package
tree. You could do this non-interactively with the command line
options setup.exe -q -L -l x:\cygwin-local\, where your downloaded
package tree is in x:\cygwin-local\ (see the next FAQ for an
explanation of those options.)
For other options, search the mailing lists with terms such as cygwin
automated setup or automated cygwin install.
I have found some of the key places where this is discussed:
- Cygwin Mailing List: Clone cygwin-setup settings from one PC to another
- Cygwin Mail Archive: question on backup
- Cygwin Mailing List: Automated cygwin install
- Cygwin Mailing List: Possible to copy whole cygwin folder to different machine?
- helix' blog: Install cygwin-packages from the cmdline
You may want to look into using cygcheck as well.
Also: I have not tested this myself, but there is now a project called apt-cyg which looks like it works in a similar way to debian's apt-get. Here is the project page
Copy Cygwin Packages to a New System
Here is an easy way I've found to duplicate an installation to multiple systems with updated packages upon install time:
#Save some copies of the /etc/setup/installed.db file
cp /etc/setup/installed.db ~/installed.db.bak
cp /etc/setup/installed.db ~/installed.db
#Create a sed script to zero version numbers
cat > ~/zero-version-nums.sed<<-'EOM'
s/-[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9a-zA-Z]\+-[0-9]\+\.tar/-0.0.0.0-0.tar/
s/-[0-9]\+\.[0-9]\+\.[0-9a-zA-Z]\+-[0-9]\+\.tar/-0.0.0-0.tar/
s/-[0-9]\+\.[_+0-9a-zA-Z]\+-[0-9]\+\.tar/-0.0-0.tar/
s/-[0-9a-zA-Z]\+-[0-9]\+\.tar/-0-0.tar/
s/-[0-9]\+\.tar/-0.tar/
EOM
# Change all version numbers to 0 (run sed script)
sed -i -f ~/zero-version-nums.sed ~/installed.db
Now simply copy this file to the new machine in C:\cygwin\etc\setup\installed.db, and run the Setup.exe installer. The packages listed should be automatically selected for update. It may be possible to automate this process using the tips I mentioned above, and here.
Sources:
- Cygwin Mailing List
- Code snippet on Snipplr: Sed script
- Blog Post: Install cygwin-packages from the cmdline
- Cygwin Mail Archive: question on backup