Skip to content

Instantly share code, notes, and snippets.

@thegreatchrispy
Last active May 17, 2019 05:22
Show Gist options
  • Save thegreatchrispy/51676a64cfdd829757c31d22dfdc49b8 to your computer and use it in GitHub Desktop.
Save thegreatchrispy/51676a64cfdd829757c31d22dfdc49b8 to your computer and use it in GitHub Desktop.
This is my preferred installation of Cygwin for Windows 10, including all libraries I find most useful.

THEGREATCHRISPY'S GUIDE TO INSTALLING CYGWIN ON WINDOWS 10

Here I am documenting my process for downloading, installing, and tweaking the settings for Cygwin, a Linux-based environment that runs on Windows. This is largely to help myself, so that I won't have to hunt down and rediscover processes and settings that I have already figured out in the past. However, I also want this to help as many people other than myself as possible. So lets dive into Cygwin.

DISCLAIMER: This guide assumes some knowledge about computers, such as the difference between 32-bit and 64-bit architectures and how to determine your computer's architecture.


What is Cygwin?

This is the description of Cygwin from their own website:

  1. a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
  2. a DLL (cygwin1.dll) which provides substantial POSIX API functionality.

If that sounds like the kind of functionality that you want, then we are ready to get into the installation/tweaking process.


Installation

Start by navigating to cygwin's website to download the installer. Be sure to install the appropriate installer for your computer's architecture (e.g. 32-bit vs. 64-bit). Running the installer will take you through a series of questions:

  • Download source should be Install from the Internet.
  • Choose your settings for your Cygwin installation:
    • Choose where your Root Directory will be. I always choose C:\Program_Files\cygwin, for All Users.
    • All Users, or Just Me is your choice and is up to your installation needs and/or permissions you have on your machine.
    • Next, you need to create a local folder for installation files. You can use any file location you want, but I typically use C:\Program_Files\cygwin\local
    • Select your Internet Connection. I typically use the default, but if you have a preference, then feel free to use that for your download source. Next, if you chose the default, you need to pick a connection source to download from. My preference is to use .edu domains, because they are more trustworthy in my opinion. But please feel free to choose any source that you feel comfortable downloading from, or add your own URL.
    • Now comes the fun part: Choosing which packages/libraries we want to download for our personal distribution.

Libraries/Packages

List of installed libraries/packages goes here...


Setting Environment Variables

So now that your libraries and packages are installed, Cygwin is ready to go. However, you will quickly notice that in order to run any of the new commands from your freshly installed libraries, you will have to run them from the Cygwin prompt rather than Windows' built-in cmd.exe command prompt. If you don't mind using the Cygwin prompt, then this is fine and your installation process is finished. However, if you would like to use cmd instead, then there is one more step to complete. We need to point the Path environment variable to where our Cygwin installation is stored in our filesystem so that cmd will be able to find the commands. There are several ways to get to the environment variables, but I had to choose one so here is that process:

  • From the start menu, open the Control Panel
  • Go to System and Security
  • Go to System
  • On the left, click on Advanced system settings
  • Go to Environment Variables...
  • Under System variables, search for a variable named Path. Click on this and then click the Edit... button.
  • Click New and enter the the file path to the bin folder of your Cygwin installation. For example, since I chose C:\Program_Files\cygwin as my installation directory, then here I would type C:\Program_Files\cygwin\bin
  • Now just click OK in all three of the open dialog boxes, and you will be ready to use linux commands from cmd! To test things out, try opening cmd and running pwd or ls. You should get results back, and if you do get a message that these commands do not exist, then try closing and re-opening the cmd prompt, or run through these steps again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment