Cygwin Installation

From A-State Computer Science Wiki
Jump to: navigation, search

Current Version

Last Update: August 5, 2011
Cygwin Version: 1.7.9-1
Cygwin Setup Version: 2.738

While the Cygwin setup version may change from year to year, the setup screens do not. Therefore, the version numbers in the pictures below may not match up with the current version listed above. The pictures below will only be update if there is a change in the setup screens.

Introduction

This guide provides instructions on how to install and setup Cygwin on your personal computer using either our mirror or the main Cygwin site. The same procedure is used to install Cygwin in the Computer Science Labs. These instructions assume that you are installing Cygwin (for the first time) on a machine that does not already have Cygwin installed.

Our mirror is updated every August. While this may mean that we are not running the latest version, it does ensure that the Fall and Spring semester of each school year are consistent. For this reason we recommend that you use our mirror to install Cygwin.

Note: These instructions have been tested on Windows XP Professional with Service Pack 3. They should work on prior versions of XP and on XP Home. We do not run Windows Vista or 7 in our labs, therefore we cannot guarantee that these instructions will work on either version.

Note: Our mirror server changed after the initial creation of this document. All references to our mirror have been changed to the correct server; however, pictures were not re-generated so all the pictures still reference the old server. Please make sure to use the server listed under the "Where to get Cygwin section."

Where to get Cygwin

Cygwin can be downloaded from the Cygwin website or from the Computer Science Mirror Server (http://mirror.cs.astate.edu).

Multi-User Environment

Set the file premissions on /tmp and /var/log for the account type "Users" and/or "Everyone". Make sure that they have read, write, and modify.

Installation

  1. Download the Cygwin setup.exe file from the Computer Science Mirror Server or Cygwin website and save it to your Desktop.
  2. Once the download has completed, start the setup program by double clicking on the setup.exe icon. If a security warning dialog is displayed (see Figure 1), click the “Run” button to start the setup.
    Figure 1
  3. Figure 2 depicts the first dialog of the setup process. Click “Next” to start the setup process or “Cancel” to exit.
    Figure 2
  4. There are three options for installing Cygwin, as shown in Figure 3. If not already selected, select “Install from Internet” and click "Next".
    Figure 3
  5. The next step is to select the root directory for Cygwin and some additional installation parameters. It is highly recommended that you accept the defaults, as shown in Figure 4.
    Figure 4
  6. Next, choose where to store the installation files that the setup program downloads. The default directory is your Desktop (see Figure 5). You can, however, change this to any directory that you want. After Cygwin is installed, you can safely delete this directory.
    Figure 5
  7. Next, select how you would like to connect to the Internet. The default is “Direct Connection” (shown in Figure 6) and should work for most installations. However, if you are behind a proxy you should select the third option and fill in your proxy information. If you are not sure which option to pick, try using the default one first.
    Figure 6
  8. Figures 7 and 8 show you how to use the Computer Science Cygwin mirror for installation. You do not have to use our mirror. However, by using our mirror you will have exactly the same version of Cygwin as what is installed in the Computer Science Labs.
    1. First enter in the address of our mirror: http://mirror.cs.astate.edu/Cygwin/
      The URL must be typed exactly as it appears above, including the trailing forward slash.
    2. After you have entered the address of our mirror, click the “Add” button. This will add our mirror to the list of “Available Download Sites”.
      Figure 7
    3. If it is not already selected, select our mirror from the list of download sites and click “Next”.
      Figure 8

    If you did not enter the mirror's URL correctly, you will receive download errors on the next step. Generally, these errors mention something about not finding the setup.ini file. If this happens, click the “Back” button and re-enter the URL for our mirror. It must be typed exactly as it appears above.

  9. If everything worked correctly, you should now see a screen similar to Figure 9.
    Figure 9
    Here you will choose the packages that need to be installed. The simplest method is to install everything; however, Cygwin is quite big and this could take a while to download (even using our mirror). The package selection below is not a full install, but it is still quite large. It does, however, provide a very quick and easy way to ensure that you have selected all the packages you need to install for your Computer Science classes.

    Next to each category you will see a circle with two arrows on it, followed by the installation type. The default installation type is “Default”. This selects the minimum number of packages needed in order to have a running version of Cygwin. If you click on the circle with two arrows, you will notice that the installation type changes from “Default” to “Install” to “Reinstall” and, finally, to “Uninstall”.
    1. First, change the installation type on the category “All” to “Install”. Changing the installation type on “All” may take a couple of seconds. Be patient. This will change the installation type on all the categories to “Install”, see Figure 10.
      Figure 10
      Now it is time to trim the installation down. Change the installation type of the following categories to “Default”:
      • Accessibility
      • Admin
      • Audio
      • Database
      • Games
      • Gnome
      • Mail
      • Math
      • Net
      • Publishing
      • Shells
      • Text
      • Utils
      • Web
    2. Now click on the plus sign next to the “Net” category. Notice that each package in the category has the circle with two arrows on it. Just like for the categories, clicking on this symbol changes the installation type of the package. However, here you will only see the choice “Skip” or the package version you want to install. Some package have multiple versions, so pay attention to what you are doing. We will always install the latest package available. When you switch the installation type from “Skip”, the most recent version of the package is selected for installation. If you want an older version, simply click on the circle again to cycle through all the versions available for download.
      • Change the install type from Skip to the latest version for the openssl package.
    3. Now click on the plus sign next to the “Utils” category and change the installation type on the following packages to the latest version of each package.
      • bzip2
      • diffstat
      • diffutils
      • ncurses
      • time
      • which
    4. Now click on the plus sign next to the “Web” category and change the installation type on the following packages to the latest version of each package.
      • curl
      • wget
    5. Now that all the packages have been selected, click the “Next” button.
  10. On the "Resolve Dependencies" screen, make sure the checkbox next to “Install these packages to meet dependencies” is checked and click the “Next” button. See Figure 11 for a screenshot.
    Figure 11

    Once you click the “Next” button, the installation will begin. This step will take sometime. After it has finished, the setup program will ask if you would like to add icons to the Desktop and to the Start Menu. The choice is yours.


Optional Changes

Start-X Desktop Shortcut

If you would like a shortcut to the xterm program, right click on “Start”->”All Programs”->”Cygwin-X”->”X Win Server” and select “Send To”->”Desktop (create a shortcut)”.

Starting XTerm

To start the xterm when the server is already running, navigate to “Start”->”All Programs”->”Cygwin-X” and click on “xterm.” This will start the xterm window when the X Win Server is already running. Alternatively, you can right-click on the X-Server icon in the notification bar and then select “Applications”->”xterm”.

Disabling the XTerm Toolbar

By default, xterm starts with a toolbar. This toolbar does take some getting used to. To use the toolbar, you have to remember to keep the mouse button held down until you have made your selection. If you just click on the toolbar and then release the mouse button, the menu will close. This can be very annoying at times.

If you do not want to disable the toolbar, you can turn it off after xterm starts by clicking on the first toolbar menu option (remember to keep your mouse button held down), hover the mouse pointer over the “Toolbar” option and then release the mouse button.

Disable the toolbar for all users

Disable the toolbar on xterm started from the XWin Server Icon in the System Tray
  • Open the file C:\cygwin\etc\X11\system.XWinrc in WordPad or some other text editor. NotePad is not recommended for editing this file as the file contains some formatting that NotePad does not understand.
  • You need to edit the Menu Apps section of the file. It should look like this:
menu apps {
	xterm	exec	"xterm"
	"Emacs"	exec	"emacs"
	notepad	exec	notepad
	xload	exec	"xload -display %display%"  # Comment
}

Change the line ' xterm exec "xterm" ' to ' xterm exec "xterm +tb" '. (Without the single quotes.) The +tb tells xterm to disable the toolbar.

Disable toolbar on xterm started from the "All Programs" menu
  • Right Click on "Start"->"All Programs"->"Cygwin-X"->"xterm" and select "Properties"
  • Change the "Target" from
    C:\cygwin\bin\run.exe -p /usr/X11R6/bin xterm -display 127.0.0.1:0.0 -ls
    
    to
    C:\cygwin\bin\run.exe -p /usr/X11R6/bin xterm +tb -display 127.0.0.1:0.0 -ls
    
    Again the +tb after xterm disables the toolbar.

Disable the toolbar for your user account only

  • Open the Cygwin terminal
  • Make sure that you are in your home directory
    $ cd ~
    
  • Create the file .Xdefaults
    $ vi .Xdefaults
    
  • Add the following line (Note the capitalization and the spaces.)
    XTerm*toolBar: false
    
  • Save the file. Now when xterm starts it will not have a toolbar and it will only affect your user account.