CS Electrical And Electronics
@cselectricalandelectronics
All PostsEmbedded SystemOperating SystemProgramming

How To Install CYGWIN On Windows 10 Step By Step Procedure

Hello guys, welcome back to my blog. In this article, I will discuss how to install CGWIN on windows 10 step by step procedure, what is CYGWIN, the procedure for CYGWIN installation, how to use Cygwin to execute programs, etc.

If you have any doubts related to electrical, electronics, and computer science, then ask question. You can also catch me @ Instagram – Chetan Shidling. 

Also, read:

How To Install CYGWIN On Windows 10

What is CYGWIN?

Cygwin is a distribution of several GNU and other Open-Source tools running on Microsoft Windows. Cygwin provides similar functionality as Linux distributions except on Windows. Cygwin is dll (cygwin1.dll) which acts as a Linux API layer giving Linux API functionality. Cygwin contains thousands of packages from the Open-Source world.

Cygwin is supported on all modern released versions of Windows – Vista, 7, 8, 8.1, 10, Windows Server 2008, and all later versions of Windows, except Windows S mode. Even though it is not possible to run Linux native apps on Windows directly, but it is certainly possible to rebuild those apps and run them on Windows.

How to install CYGWIN On Windows 10?

The steps below will help installing Cygwin on your system.

01. Step1: Download the installer file setup-x86_64.exe (64 bit) (recommended) and setupx86.exe(32 bit). The setup files can be downloaded from the Cygwin home page – https://cygwin.com/

Download the installer file setup-x86_64.exe

02. Step2: Run the installer and start by hitting Next

Run the installer and start

03. Step 3: It is ok to choose any of the option as per your convenience however first-time installation is recommended to be installed from the internet as it downloads and install all the base packages by itself.

 Step 3: It is ok to choose any of the option

04. Step 4: Select the root directory for your Cygwin distribution on your Windows. You can choose any directory except It is recommended not choose the root directory of Cygwin directly as your root of Windows as it might throw errors later when as some critical Cygwin directories like etc, lib and bin might get corrupted by other non-Cygwin applications or packages that use \etc, \lib, \bin.

You can select Cygwin to be available for all the users on your system or you can choose Just Me as per your preference.

Select the root directory for your Cygwin distribution on your Windows.

05. Step 5: Choose a local package directory for your Cygwin packages. This directory keeps all the files for the packages before installing them.

Choose a local package directory for your Cygwin packages

06. Step 6: Choose the type of connection.

07. Step 7: Choose the mirror nearest to you like this

Choose the mirror nearest to you like this

08. Step 8: This will open you a dialogue box to select and view the package you want to install or which packages you already have by surfing from here. If you are installing Cygwin for the first time. You can select Full/Category to view all the packages Cygwin currently has.

This will open you a dialogue box to select and view the package you want to install

09. Step 9: By default, Cygwin will install the base packages which includes script writing with vim, etc. You can also download the package according to your requirement however in this document we will be focusing on tools like make compiler collection for c and c++ and GNU debugger.

To select those,

  • you can search the names directly in the search bar.
  • check the box mentioning devel/debug.
  • select on version you want to install.
  • do this for all the packages you want to install.
  • hit Next.
By default, Cygwin will install the base packages

10. Step 10: For compiling c codes, debugging and using make command, these packages are to be installed.

  • gcc-core (GNU Compiler Collection(C, OpenMP))
  • gdb (The GNU Debugger)
  • make (The GNU version of the make utility
For compiling c codes, debugging and using make command

11. Step 11: Shows you the list of files you are about to download and install. Hit Next

Shows you the list of files you are about to download and install. Hit Next

12. Step 12: This will start the process. It might take a while depending on the number of packages you are installing.

13. Step 13: Select and hit Next.

Select and hit Next

14. Step 14: This completes the installation part. Now a very important step is left which includes adding the bin directory of Cygwin to the path of the environment variables so that it can automatically detect the base directory.

  • Go to the folder where Cygwin\bin is installed which in this case is C:\cygwin64\bin
  • Copy this path.
  • Go to the properties of My computer and navigate to Advanced System settings
  • Click on environment Variables.
This completes the installation part.
  • Select Path and click on Edit.
  • Click on New and paste the location of the Cygwin\bin
  • Click Ok, Ok and Ok.

You are all set to work in a Linux environment on Windows.

Basic Keywords which may come in handy:

01. man = Displays the manual page for the given command (try “man man”). If you do not find the manual page for some of the commands given on these pages, I would guess that it is because it is one of the commands that are handled directly by bash – see if you find it at “man bash”.

02. pwd = “Print Working Directory” – tells you in which directory you are.

03. ls = lists the files in the current directory (except the hidden ones)

04. cd = “Change Directory”. Give the name of the directory you want to be your new current directory – either relative to where you are, or absolute, relative to the file system tree “root” at “/”.

05. cp = “Copy” a file: “cp hello1.c hello2.c” will make hello2.c a copy of hello1.c

06. mv =move (and/or rename) a file.

07. rm = remove/delete a file.

08. mkdir =makes a new directory

09. rmdir =removes a directory

How to use Cygwin to execute programs?

01. Open the Cygwin Terminal and move to the directory to store the program.

Open the Cygwin Terminal and move to the directory

02. Create any C source file let’s say “hello.c” using the command $ touch hello.c in the specified directory (or create it manually using:

  • Open an editor for instance Notepad ++ is used for reference here.
  • Write the program and save it as hello (for example) with a C source file extension i.e., hello.c.
 Create any C source file let’s say “hello.c” using the command $ touch hello.c
“hello.c” using the command $

03. Open the C source file in any text editor, write your program and save.

04. Now to create an executable use the command:

$ gcc hello.c -o hello.exe

gcc hello.c -o hello.exe

05. This will create an executable file for the program “hello”.

06. To run the executable just use the command:

$ ./hello.exe

executable just use the command:

Here ./ represents the exact address of the file hello.exe from the root. Instead of the ./ we can also use the full path of the executable hello.exe .

Thank you for reading ” How To Install CYGWIN On Windows 10 “. I hope this article ” How To Install CYGWIN On Windows 10 ” may help you all a lot.

Also, read:

Author Profile

CS Electrical And ElectronicsChetu
Interest's ~ Engineering | Entrepreneurship | Politics | History | Travelling | Content Writing | Technology | Cooking
Share Now

CS Electrical And Electronics

Interest's ~ Engineering | Entrepreneurship | Politics | History | Travelling | Content Writing | Technology | Cooking

Leave a Reply

Your email address will not be published. Required fields are marked *