Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

To search and download a package missed from Cygwin I need to run setup.exe GUI each time, click many times and do other boring things.

Is there a way to do the same from Cygwin's command line directly? Like apt-get tools do.

share|improve this question
Excellent question! –  Luc M Nov 25 '10 at 1:08

5 Answers 5

up vote 26 down vote accepted

Take a look here:

Aside from the other things, it gives the following list of options to setup.exe:

Command Line Options:
 -A --disable-buggy-antivirus           Disable known or suspected buggy anti
                    virus software packages during execution.
 -C --categories                        Specify entire categories to install
 -D --download                          Download from internet
 -d --no-desktop                        Disable creation of desktop shortcut
 -h --help                              print help
 -K --pubkey                            Path to extra public key file (gpg format)
 -L --local-install                     Install from local directory
 -l --local-package-dir                 Local package directory
 -n --no-shortcuts                      Disable creation of desktop and start menu
 -N --no-startmenu                      Disable creation of start menu shortcut
 -O --only-site                         Ignore all sites except for -s
 -P --packages                          Specify packages to install
 -p --proxy                             HTTP/FTP proxy (host:port)
 -q --quiet-mode                        Unattended setup mode
 -r --no-replaceonreboot                Disable replacing in-use files on next
 -R --root                              Root installation directory
 -S --sexpr-pubkey                      Extra public key in s-expr format
 -s --site                              Download site
 -U --keep-untrusted-keys               Use untrusted keys and retain all
 -u --untrusted-keys                    Use untrusted keys from last-extrakeys
 -X --no-verify                         Don't verify setup.ini signatures

So setup.exe -P <package name> should do the job. Don't have cygwin right here, so test it to confirm it works as expected.

To search for a package, per:

you can use cygcheck -p:

  cygcheck -p REGEXP
  -p, --package-query  search for REGEXP in the entire cygwin.com package
                       repository (requires internet connectivity)

which produces output like (example from above site):

$ cygcheck -p 'libexpat.*\.a'
Found 2 matches for 'libexpat.*\.a'.

expat-1.95.7-1            XML parser library written in C
expat-1.95.8-1            XML parser library written in C
share|improve this answer
Caveat: if the update replaces cygwin1.dll, Cygwin programs will start to misbehave, and the Cygwin documentations recommend a reboot. So it's best to close all Cygwin programs, then run setup.exe directly from cmd (if you want to automate, use a batch file, not a shell script). –  Gilles Nov 25 '10 at 1:52
Thanks! Another thing I need is the ability to search, because I don't know yet what a package I want to download. Once I'll find the full list of packages I could grep it at least... –  Pavel Vlasov Nov 25 '10 at 12:18
See the edit for an example. –  icyrock.com Nov 25 '10 at 14:02

Expanding on @Johnny's answer http://superuser.com/a/624731/110335

The annoyance I faced were occasion prompts that the .ini file is from a newer version of Cygwin's setup.exe

I wrote myself the following script to self-update, and then update all that needs to, noninteractively.


@echo on
cd /d e:\cygwin
move /y cygwinSetup-x86_64.exe   setup-x86_64.exe
wget --progress=dot -S -N  http://cygwin.com/setup-x86_64.exe
move /y  setup-x86_64.exe cygwinSetup-x86_64.exe 

cygwinSetup-x86_64.exe   --no-desktop --no-shortcuts --no-startmenu --quiet-mode
share|improve this answer

An alternate solution would be to use the apt-cyg script available on GitHub.

share|improve this answer

The location for Cygwin's setup seems to have changes and split. Now you need either

wget http://cygwin.com/setup-x86.exe


wget http://cygwin.com/setup-x86_64.exe
share|improve this answer

This performs an unattended upgrade of all cygwin components

cd C:\cygwin
wget -N http://cygwin.com/setup.exe
setup.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode

You should reboot after the upgrade is completed to prevent cygwin apps from misbehaving due to upgraded cygwin1.dll

--no-desktop Disable creation of desktop shortcut

--no-shortcuts Disable creation of desktop and start menu

--no-startmenu Disable creation of start menu shortcut

--quiet-mode Unattended setup mode

share|improve this answer
Would you mind expanding on the answer to explain what each command does? –  Raystafarian Jul 27 '13 at 1:32
I believe now you may need setup-x86_64.exe or setup-x86.exe. –  drescherjm Jul 30 at 17:10

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.