User Tools

Site Tools


software:cygwin

This is an old revision of the document!


Cygwin

Getting the Cygwin Installer

The Cygwin installer executable is available at https://cygwin.com/setup-x86_64.exe. You will need it again later on, so make sure you save it (instead of just executing it this once).

Spaces in Path

Cygwin does not play well when installed in a path that contains spaces. In this context, be aware that not all Windows paths are equal; e.g. the German “C:\Programme” is actually an alias for “C:\Program Files” (which contains a space). Ideally, install to “C:\Cygwin” to avoid any problems.

First Install

For the first installation, do not make any package selections. I have experienced problems with too heavily customized package selections in the past. Just go with the default package selection (but *do* select a mirror close to you as package source).

This will not include any X11 functionality yet. We will fix that in a later step.

Home Path

Once you are done with the installation, and before you start the Cygwin shell the first time, adjust your home path.

By default Cygwin will create your user's home directory in <InstallPath>/home/<UserName>. Usually it is much more convenient to work from your %USERPROFILE% directory – you know, where Windows already created your directories for Documents, Pictures, Videos, Downloads etc.

To change the home location, navigate to <InstallPath>/etc/ and open the file nsswitch.conf in your favorite text editor. Among other things, you will find this line:

# db_home: /home/%U

Change it to:

db_home: /%H

Save the file, and from now on your Cygwin $HOME will be your Windows %USERPROFILE%.

Startup Files

Cygwin would usually provide a set of startup files when setting up a new user directory, copying the files in /etc/skel/. This, however, is only done if the directory itself did not already exist – i.e., when setting the home path as in the previous section, you will not have those skeleton files. You should copy them yourself:

cp /etc/skel/.[a-z]* ~

When a new bash shell is started, it loads setup files in the following order:

  • /etc/profile – which sets up certain Cygwin specifics and therefore looks a bit different than your average Linux /etc/profile
  • The first of
    • ~/.bash_profile
    • ~/.bash_login
    • ~/.profile

Setting up Setup

Installing additional Cygwin software is done by starting the installer executable again. My recommendation is to move setup-x86_64.exe to your Cygwin directory, and creating an alias for easy access.

software/cygwin.1644758115.txt.gz · Last modified: 2022/02/13 14:15 by solar