Installing Cygwin

Cygwin is a collection of Linux command line tools that runs on Windows. This tutorial will walk you through installing Cygwin, then installing programs like g++.

Install Cygwin

Download and run the Cygwin installer setup-x86_64.exe. More information is at https://cygwin.com/install.html.

Choose a download site in the same country, it will be faster. The Ohio State site works well from Ann Arbor (http://cygwin.osuosl.org).

Select packages

Select the packages to install. Each package provides one or more command line programs.

When you search for packages, be sure that the package name (e.g., gcc-g++) matches exactly. Note that your version might be different. You might need to make the window bigger. Keep adding new packages until you’ve added all of them. Then, click “Next”.

Continue installation

Start Cygwin

After finishing installation, start a Cygwin shell, which is now a program installed on your Windows machine.


Where are my Windows files? They’re in your Windows home directory /cygdrive/c/Users/awdeorio/. You have a separate Cygwin home directory, e.g., /home/awdeorio/.

$ cd ~                             # Tilde means "my Cygwin home"
$ pwd
$ cd /cygdrive/c/Users/awdeorio/   # Windows home
$ pwd

You can “double click” from the Cygwin command line. This will open a file with the Windows default program.

$ cygstart babychickens.jpg

Installing additional packages

If you need to install additional packages, re-run the Cygwin installer and select additional packages. Don’t worry, it won’t mess up your existing Cygwin install. If you need to, re-download the installer setup-x86_64.exe.

When you search for packages, you might need to make the window bigger. Select the additional packages, then click “Next”.

If Cygwin setup gives you a “Package file [binutils] has a corrupt local copy, please remove and retry”:

  1. Quit the Cygwin installer
  2. Quit the Cygwin terminal
  3. Using the windows file explorer, navigate to the directory that contains the Cygwin installer (e.g., Downloads or Desktop).
  4. Delete the folder that starts with http%3a%2f%2f ...
  5. Re-run the Cygwin installer (setup-x86_64.exe)

Next steps

Return to the main set up tutorial.