Setting up Cygwin What is the recommended installation procedure? There is only one recommended way to install Cygwin, which is to use the Cygwin Setup program, a GUI installer named setup-x86_64.exe for 64 bit Windows, or setup-x86.exe for 32 bit Windows. It is flexible and easy to use. You can pick and choose the packages you wish to install, and update them individually. Full source code is available for all packages and tools. More information is available on using the Cygwin Setup program. If you do it any other way, you're on your own! If something doesn't work right for you, and it's not covered here or in the latest development snapshot at , then by all means report it to the mailing list. For a searchable list of packages that can be installed with Cygwin, see . What about an automated Cygwin installation? 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 the Cygwin Setup program as a "Local Install" pointed at your downloaded package tree. You could do this non-interactively with the command line options -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. Does the Cygwin Setup program accept command-line arguments? Yes, run the Cygwin Setup program with option --help for an up to date list: --allow-unsupported-windows Allow old, unsupported Windows versions -a --arch Architecture to install (x86_64 or x86) -C --categories Specify entire categories to install -o --delete-orphans Remove orphaned packages -A --disable-buggy-antivirus Disable known or suspected buggy anti virus software packages during execution. -D --download Download packages from internet only -f --force-current Select the current version for all packages -h --help Print help -I --include-source Automatically install source for every package installed -i --ini-basename Use a different basename, e.g. "foo", instead of "setup" -U --keep-untrusted-keys Use untrusted keys and retain all -L --local-install Install packages from local directory only -l --local-package-dir Local package directory -m --mirror-mode Skip package availability check when installing from local directory (requires local directory to be clean mirror!) -B --no-admin Do not check for and enforce running as Administrator -d --no-desktop Disable creation of desktop shortcut -r --no-replaceonreboot Disable replacing in-use files on next reboot. -n --no-shortcuts Disable creation of desktop and start menu shortcuts -N --no-startmenu Disable creation of start menu shortcut -X --no-verify Don't verify setup.ini signatures --no-version-check Suppress checking if a newer version of setup is available --old-keys Enable old cygwin.com keys -O --only-site Do not download mirror list. Only use sites specified with -s. -M --package-manager Semi-attended chooser-only mode -P --packages Specify packages to install -p --proxy HTTP/FTP proxy (host:port) -Y --prune-install Prune the installation to only the requested packages -K --pubkey URL or absolute path of extra public key file (RFC4880 format) -q --quiet-mode Unattended setup mode -c --remove-categories Specify categories to uninstall -x --remove-packages Specify packages to uninstall -R --root Root installation directory -S --sexpr-pubkey Extra DSA public key in s-expr format -s --site Download site URL -u --untrusted-keys Use untrusted saved extra keys -g --upgrade-also Also upgrade installed packages --user-agent User agent string for HTTP requests -v --verbose Verbose output -V --version Show version -W --wait When elevating, wait for elevated child process Can I install Cygwin without administrator rights? Yes. The default installation requests administrator rights because this allows to set up the Cygwin environment so that all users can start a Cygwin shell out of the box. However, if you don't have administrator rights for your machine, and the admins don't want to install it for you, you can install Cygwin just for yourself by downloading the Cygwin Setup program, and then start it from the command line or via the "Run..." dialog from the start menu using the --no-admin option, for instance: setup-x86_64.exe --no-admin Why not install in C:\? The Cygwin Setup program will prompt you for a "root" directory. The default is C:\cygwin, but you can change it. You are urged not to choose something like C:\ (the root directory on the system drive) for your Cygwin root. If you do, then critical Cygwin system directories like etc, lib and bin could easily be corrupted by other (non-Cygwin) applications or packages that use \etc, \lib or \bin. Perhaps there is no conflict now, but who knows what you might install in the future? It's also just good common sense to segregate your Cygwin "filesystems" from the rest of your Windows system disk. (In the past, there had been genuine bugs that would cause problems for people who installed in C:\, but we believe those are gone now.) Can I use the Cygwin Setup program to get old versions of packages (like gcc-2.95)? The Cygwin Setup program can be used to install any packages that are on a Cygwin mirror, which usually includes at least one version previous to the current one. The complete list may be searched at . There is no complete archive of older packages. If you have a problem with the current version of a Cygwin package, please report it to the mailing list using the guidelines at . That said, if you really need an older package, you may be able to find an outdated or archival mirror by searching the web for an old package version (for example, gcc2-2.95.3-10-src.tar.bz2), but keep in mind that this older version will not be supported by the mailing list and that installing the older version will not help improve Cygwin. How does Cygwin secure the installation and update process? Here is how Cygwin secures the installation and update process to counter man-in-the-middle (MITM) attacks: The Cygwin website provides the Cygwin Setup program (setup-x86.exe or setup-x86_64.exe) using HTTPS (SSL/TLS). This authenticates that the Cygwin Setup program came from the Cygwin website (users simply use their web browsers to download the Cygwin Setup program). You can use tools like Qualsys' SSL Server Test, , to check the HTTPS configuration of Cygwin. The cygwin.com site supports HTTP Strict Transport Security (HSTS), which forces the browser to keep using HTTPS once the browser has seen it before (this counters many downgrade attacks). The Cygwin Setup program has the Cygwin public key embedded in it. The Cygwin public key is protected from attacker subversion during transmission by the previous step, and this public key is then used to protect all later steps. You can confirm that the key is in the Cygwin Setup program by looking at the setup project () source code file cyg-pubkey.h (the key is automatically generated from file cygwin.pub). The Cygwin Setup program downloads the package list setup.ini from a mirror and checks its digital signature. The package list is in the files setup.xz, setup.zst, setup.bz2 (compressed) or setup.ini (uncompressed) on the selected mirror. The package list includes for every official Cygwin package the package name, cryptographic hash, and length (in bytes). The Cygwin Setup program also gets the relevant .sig (signature) file for that package list, and checks that the package list is properly signed with the Cygwin public key embedded in the Setup program. A mirror could corrupt the package list and/or signature, but this would be detected by the Cygwin Setup program's signature detection (unless you use the -X option to disable signature checking). The Cygwin Setup program also checks the package list timestamp/version and reports to the user if the file goes backwards in time; that process detects downgrade attacks (e.g., where an attacker subverts a mirror to send a signed package list that is older than the currently-downloaded version). The packages to be installed (which may be updates) are downloaded and both their lengths and cryptographic hashes (from the signed setup.xz/.zst/.bz2/.ini file) are checked. Non-matching packages are rejected, countering any attacker's attempt to subvert the files on a mirror. Cygwin currently uses the cryptographic hash function SHA-512 for the setup.ini files. Cygwin uses the cryptographic hash algorithm SHA-512 as of 2015-03-23. The earlier 2015-02-06 update of the setup program added support for SHA-512 (Cygwin previously used MD5). There are no known practical exploits of SHA-512 (SHA-512 is part of the widely-used SHA-2 suite of cryptographic hashes). What else can I do to ensure that my installation and updates are secure? To best secure your installation and update process, download the Cygwin Setup program setup-x86_64.exe (64-bit) or setup-x86.exe (32-bit), and then check its signature (using a signature-checking tool you trust) using the Cygwin public key (). This was noted on the front page for installing and updating. If you use the actual Cygwin public key, and have an existing secure signature-checking process, you will counter many other attacks such as subversion of the Cygwin website and malicious certificates issued by untrustworthy certificate authorities (CAs). One challenge, of course, is ensuring that you have the actual Cygwin public key. You can increase confidence in the Cygwin public key by checking older copies of the Cygwin public key (to see if it's been the same over time). Another challenge is having a secure signature-checking process. You can use GnuPG to check signatures; if you have a trusted Cygwin installation you can install GnuPG. Otherwise, to check the signature you must use an existing trusted tool or install a signature-checking tool you can trust. Not everyone will go through this additional effort, but we make it possible for those who want that extra confidence. We also provide automatic mechanisms (such as our use of HTTPS) for those with limited time and do not want to perform the signature checking on the Cygwin Setup program itself. Once the correct Setup program is running, it will counter other attacks as described in . Is the Cygwin Setup program, or one of the packages, infected with a virus? Unlikely. Unless you can confirm it, please don't report it to the mailing list. Anti-virus products have been known to detect false positives when extracting compressed tar archives. If this causes problems for you, consider disabling your anti-virus software when running the Cygwin Setup program. Read the next entry for a fairly safe way to do this. My computer hangs when I run Cygwin Setup! Both Network Associates (formerly McAfee) and Norton anti-virus products have been reported to "hang" when extracting Cygwin tar archives. If this happens to you, consider disabling your anti-virus software when running the Cygwin Setup program. The following procedure should be a fairly safe way to do that: Download setup-x86_64.exe or setup-x86.exe and scan it explicitly. Turn off the anti-virus software. Run the Cygwin Setup program to download and install or upgrade all desired packages. Re-activate your anti-virus software and scan everything in C:\cygwin (or wherever you chose to install), or your entire hard disk if you are paranoid. This should be safe, but only if the Cygwin Setup program is not substituted by something malicious. See also for a description of how the Cygwin project counters man-in-the-middle (MITM) attacks. See also for a list of applications that have been known, at one time or another, to interfere with the normal functioning of Cygwin. What packages should I download? Where are 'make', 'gcc', 'vi', etc? When using the Cygwin Setup program for the first time, the default is to install a minimal subset of all available packages. If you want anything beyond that, you will have to select it explicitly. See for a searchable list of available packages, or use cygcheck -p as described in the Cygwin User's Guide at . If you want to build programs, of course you'll need gcc, binutils, make and probably other packages from the ``Devel'' category. Text editors can be found under ``Editors''. How do I just get everything? Long ago, the default was to install everything, much to the irritation of most users. Now the default is to install only a basic core of packages. The Cygwin Setup program is designed to make it easy to browse categories and select what you want to install or omit from those categories. There are now more than 10000 Cygwin packages requiring more than 150GB of disk space just to download and hundreds of GB more to install so you are strongly advised not to attempt to install everything at once, unless you have a lot of free disk space, a very high speed network connection, and the system will not be required for any other purpose for many hours (or days) until installation completes. For a 32-bit Cygwin installation, you can not install everything, as the installation will fail because the 4GB memory available is insufficient to allow all the DLLs required to run along with the programs using them. How much disk space does Cygwin require? That depends, obviously, on what you've chosen to download and install. A full installation today is many hundreds of GB installed, not including the package archives themselves nor the source code. After installation, the package archives remain in your ``Local Package Directory''. By default the location of the Cygwin Setup program. You may conserve disk space by deleting the subdirectories there. These directories will have very weird looking names, being encoded with their URLs (named http%3a%2f...cygwin...%2f). Of course, you can keep them around in case you want to reinstall a package. If you want to clean out only the outdated packages, Michael Chase has written a script called clean_setup.pl, available at unsupported/clean_setup.pl in a Cygwin mirror. How do I know which version I upgraded from? Detailed logs of the most recent Cygwin Setup session can be found in /var/log/setup.log.full and less verbose information about prior actions is in /var/log/setup.log. What if the Cygwin Setup program fails? First, make sure that you are using the latest version of the Cygwin Setup program. The latest version is always available from the Cygwin Home Page at . If you are downloading from the Internet, setup will fail if it cannot download the list of mirrors at . It could be that the network is too busy. Something similar could be the cause of a download site not working. Try another mirror, or try again later. If the Cygwin Setup program refuses to download a package that you know needs to be upgraded, try deleting that package's entry from /etc/setup. If you are reacting quickly to an announcement on the mailing list, it could be that the mirror you are using doesn't have the latest copy yet. Try another mirror, or try again tomorrow. If the Cygwin Setup program has otherwise behaved strangely, check the files setup.log and setup.log.full in /var/log (C:\cygwin\var\log by default). It may provide some clues as to what went wrong and why. If you're still baffled, search the Cygwin mailing list for clues. Others may have the same problem, and a solution may be posted there. If that search proves fruitless, send a query to the Cygwin mailing list. You must provide complete details in your query: version of the Cygwin Setup program, options you selected, contents of setup.log and setup.log.full, what happened that wasn't supposed to happen, etc. My Windows logon name has a space in it, will this cause problems? Most definitely yes! UNIX shells (and thus Cygwin) use the space character as a word delimiter. Under certain circumstances, it is possible to get around this with various shell quoting mechanisms, but you are much better off if you can avoid the problem entirely. You have two choices: You can rename the user in the Windows User Manager GUI. If that's not possible, you can create an /etc/passwd file using the mkpasswd command. Then you can simply edit your Cygwin user name (first field). It's also a good idea to avoid spaces in the home directory. My HOME environment variable is not what I want. When starting Cygwin from Windows, HOME is determined as follows: If HOME is set in the Windows environment, translated to POSIX form. Otherwise, use the pw_home field from the passwd entry as returned by getent passwd. If you want to learn how this field is set by Cygwin and how you can change it, this is explained in great detail in the Cygwin User's Guide at . When using Cygwin from a network login (via ssh for instance), HOME is always taken from the passwd entry. If your HOME is set to a value such as /cygdrive/c, it is likely that it was set in Windows. Start a DOS Command Window and type "set HOME" to verify if this is the case. Access to shared drives is often restricted when starting from the network, thus Domain users may wish to have a different HOME in the Windows environment (on shared drive) than in Cygwin (on local drive). Note that ssh only considers the account information as retrieved by getpwnam(3), disregarding HOME. How do I uninstall individual packages? Run the Cygwin Setup program as you would to install packages. In the list of packages to install, browse the relevant category or click on the ``View'' button to get a full listing. Click on the cycle glyph until the action reads ``Uninstall''. Proceed by clicking ``Next''. How do I uninstall a Cygwin service? List all services you have installed with cygrunsrv -L. If you do not have cygrunsrv installed, skip this FAQ. Before removing the service, you should stop it with cygrunsrv --stop service_name. If you have inetd configured to run as a standalone service, it will not show up in the list, but cygrunsrv --stop inetd will work to stop it as well. Lastly, remove the service with cygrunsrv --remove service_name. How do I uninstall all of Cygwin? Setup has no automatic uninstall facility. The recommended method to remove all of Cygwin is as follows: If you have any Cygwin services running, remove by repeating the instructions in for all services that you installed. Common services that might have been installed are sshd, cron, cygserver, inetd, apache, postgresql, and so on. Stop the X11 server if it is running, and terminate any Cygwin programs that might be running in the background. Exit the command prompt and ensure that no Cygwin processes remain. Note: If you want to save your mount points for a later reinstall, first save the output of mount -m as described at . If you installed cyglsa.dll by running the shell script /usr/bin/cyglsa-config as described in , then you need to configure Windows to stop using the LSA authentication package. You do so by editing the registry and restoring /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa/Authentication Packages back to it's original value of msv1_0, and then rebooting. Delete the Cygwin root folder and all subfolders. If you get an error that an object is in use, then ensure that you've stopped all services and closed all Cygwin programs. If you get a 'Permission Denied' error then you will need to modify the permissions and/or ownership of the files or folders that are causing the error. For example, sometimes files used by system services end up owned by the SYSTEM account and not writable by regular users. The quickest way to delete the entire tree if you run into this problem is to take ownership of all files and folders to your account. To do this in Windows Explorer, right click on the root Cygwin folder, choose Properties, then the Security tab. If you are using Simple File Sharing, you will need to boot into Safe Mode to access the Security tab. Select Advanced, then go to the Owner tab and make sure your account is listed as the owner. Select the 'Replace owner on subcontainers and objects' checkbox and press Ok. After Explorer applies the changes you should be able to delete the entire tree in one operation. Note that you can also achieve by using other tools such as icacls.exe or directly from Cygwin by using chown. Please note that you shouldn't use the recursive form of chown on directories that have other file systems mounted under them (specifically you must avoid /proc) since you'd change ownership of the files under those mount points as well. Delete the Cygwin shortcuts on the Desktop and Start Menu, and anything left by the Cygwin Setup program in the download directory. However, if you plan to reinstall Cygwin it's a good idea to keep your download directory since you can reinstall the packages left in its cache without redownloading them. If you added Cygwin to your system path, you should remove it unless you plan to reinstall Cygwin to the same location. Similarly, if you set your CYGWIN environment variable system-wide and don't plan to reinstall, you should remove it. Finally, if you want to be thorough you can delete the registry tree Software\Cygwin under HKEY_LOCAL_MACHINE and/or HKEY_CURRENT_USER. However, if you followed the directions above you will have already removed everything important. Typically only the installation directory has been stored in the registry at all. How do I install snapshots? First, are you sure you want to do this? Snapshots are risky. They have not been tested. Use them only if there is a feature or bugfix that you need to try, and you are willing to deal with any problems, or at the request of a Cygwin developer. You cannot use the Cygwin Setup program to install a snapshot. First, you will need to download the snapshot from the snapshots page at . Note the directory where you saved the snapshot tarball. Before installing a snapshot, you must first Close all Cygwin applications, including shells and services (e.g., inetd, sshd). You will not be able to replace cygwin1.dll if any Cygwin process is running. You may have to restart Windows to clear the DLL from memory (beware of automatic service startup). Most of the downloaded snapshot can be installed using tar. Cygwin tar won't be able to update /usr/bin/cygwin1.dll (because it's used by tar itself), but it should succeed with everything else. If you are only installing the DLL snapshot, skip the first tar command. Open a bash shell (it should be the only running Cygwin process) and issue the following commands: /bin/tar -C / -xvf /posix/path/to/cygwin-inst-YYYYMMDD.tar.* --exclude=usr/bin/cygwin1.dll /bin/tar -C /tmp -xvf /posix/path/to/cygwin-inst-YYYYMMDD.tar.* usr/bin/cygwin1.dll Exit the bash shell, and use Explorer or the Windows command shell to first rename C:\cygwin\bin\cygwin1.dll to C:\cygwin\bin\cygwin1-prev.dll and then move C:\cygwin\tmp\usr\bin\cygwin1.dll to C:\cygwin\bin\cygwin1.dll (assuming you installed Cygwin in C:\cygwin). The operative word in trying the snapshots is "trying". If you notice a problem with the snapshot that was not present in the release DLL (what we call a "regression"), please report it to the Cygwin mailing list (see for problem reporting guidelines). If you wish to go back to the older version of the DLL, again, close all Cygwin processes, delete C:\cygwin\bin\cygwin1.dll, and rename C:\cygwin\bin\cygwin1-prev.dll back to C:\cygwin\bin\cygwin1.dll (again assuming that your "/" is C:\cygwin). To restore the rest of the snapshot files, reinstall the "cygwin" package using the Cygwin Setup program. Can the Cygwin Setup program maintain a ``mirror''? NO. The Cygwin Setup program cannot do this for you. Use a tool designed for this purpose. See , for utilities that can do this for you. For more information on setting up a custom Cygwin package server, see the Cygwin Setup program page. How can I make my own portable Cygwin on CD? While some users have successfully done this, for example Indiana University's XLiveCD , there is no easy way to do it. Full instructions for constructing a portable Cygwin on CD by hand can be found on the mailing list at (Thanks to fergus at bonhard dot uklinux dot net for these instructions.) Please note that these instructions are very old and are referring to the somewhat different setup of a Cygwin 1.5.x release. As soon as somebody set this up for recent Cygwin releases, we might add this information here. How do I save, restore, delete, or modify the Cygwin information stored in the registry? Cygwin doesn't store anything important in the registry anymore for quite some time. There's no reason to save, restore or delete it.