Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I set up Cygwin to automatically update itself?

How can I get Cygwin to download a package without having to go via the GUI thing?

share|improve this question
1  
Cygwin runs on Windows; this probably belongs on SU –  Michael Mrozek Sep 7 '10 at 2:36
1  
Urgh. Cygwin is a version of Unix. –  delete Sep 7 '10 at 2:45
1  
I know a good number of people that would cry hearing "Cygwin is a version of Unix", but I guess we'll go with it –  Michael Mrozek Sep 7 '10 at 2:55
add comment

2 Answers 2

up vote 7 down vote accepted

Cygwin : Unix :: Peaches : Trombone (that was on my GRE ;)

Given how dramatic Cygwin changes can be, I'd be really wary of having it done without my explicit consent. If you are daring, you could invoke cron to run whatever update script you might choose.

If you were looking for the ill-documented setup.exe --quiet-mode for unattended operation, there it is.

share|improve this answer
add comment

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:

  1. Cygwin Mailing List: Clone cygwin-setup settings from one PC to another
  2. Cygwin Mail Archive: question on backup
  3. Cygwin Mailing List: Automated cygwin install
  4. Cygwin Mailing List: Possible to copy whole cygwin folder to different machine?
  5. 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:

  1. Cygwin Mailing List
  2. Code snippet on Snipplr: Sed script
  3. Blog Post: Install cygwin-packages from the cmdline
  4. Cygwin Mail Archive: question on backup
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.