Cygwin Setup Windows 10

  1. Cygwin Setup Has Stopped Working Windows 10
  2. Cygwin Setup Windows 10 Ad Hoc
  3. Cygwin Setup Windows 10 Download
  4. Cygwin Ssh Setup Windows 10
  5. Cygwin Setup Windows 10 Windows 10
  6. Cygwin Setup Windows 10 64

2017 UPDATE: This post is quite out of date now has been updated thanks to excellent commenters. If you want a unix console on Windows 10, you should go ahead and install Ubuntu from the Windows Store. Cygwin 64bit is a collection of tools which provide a Linux look and feel environment for Windows. Cygwin is a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality. The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows. Download Cygwin for.

2017 UPDATE:

This post is quite out of date now has been updated thanks to excellent commenters. If you want a unix console on Windows 10, you should go ahead and install Ubuntu from the Windows Store. I think there are other flavours coming soon as well. Read more about it here: https://blogs.msdn.microsoft.com/commandline/2017/05/11/new-distros-coming-to-bashwsl-via-windows-store/

If you don’t have Windows 10, Jon L provided the updated details on how to get apt-cyg in the comments, and I’ve ammended this post to include that detail.

I sat down today to do some programming, and I got a little bit distracted improving my environment, but I think that where I’ve got to is quite good, so I’ll share it with you. So, what are my requirements?

  • a unix-like console with
  • an easy mechanism for installing packages
  • git, python, and other useful things
  • summary information about my git repos, at the command prompt
  • auto-completion for git
  • shortcuts to frequently used folders, and some other conveniences

A unix-like console on Windows

Setup

Have you heard of Cygwin? Cygwin is great. Cygwin is unix on Windows. Sometimes I think Microsoft should just buy Cygwin, and make it a first-class citizen of Windows. Installing Cygwin is easy, but the base install doesn’t come with many packages; you can re-run the installer to add more, but if you’re like me and you don’t save your downloads to disk, it can be a bit of a pain. Get the installer here. Don’t finish the installation just yet because…

An easy mechanism for installing packages

You’ll want to install a couple of extra packages required to install apt-cyg. I learned how to install it here. You’ll want to install cygwin with the following extra packages, to make sure you can run apt-cyg:

  • wget
  • tar
  • bzip2
  • subversion
  • vim

Cygwin Setup Has Stopped Working Windows 10

Once Cygwin is up and running do the following:

If you’re running the x86_64 version of Cgywin (which I recommend if you’re on 64-bit Windows), then you’ll also want to open up /bin/apt-cyg in a text editor:

and change the following two lines

It looks like they’ve made it deal with multiple architectures now too.

Now you’re ready to install some more useful tools!

Git, Python and other useful things

bash-completion – auto-complete for bash
ca-certificates
– allows your Cygwin environment to validate SSL certificates
curl – a useful command-line tool for accessing urls, similar to wget, but more powerful
git – a distributed version control tool
git-svn – lets git play nice with SVN
python – an interpreted programming language. I like to write shell scripts with it
python-setuptools – people use this when distributing their python stuff
rsync – handy tool for synchronizing stuff from one place to another (especially over the internet)

You should be able to install all of these with apt-cyg, it’ll handle all the dependencies:

[Update]
I forgot to mention ncurses, a library for writing text-base interfaces. I use it to create cls (see my update lower down).

Summary information about my git repos, at the command prompt

I have been using posh-git inside Windows Powershell, The thing I like about posh-git is that it gives you an overview of your repository status at your command prompt, like so:

Telling you which branch you are on, and giving you a summary of both tracked, and un-tracked changes. However, this can make my prompt quite slow in large repositories, because it takes quite a while to run the script which generates it, but I still want something like it in cygwin. What I have found, although less detailed than posh-git, is nice and quick, and it gives me a simple indicator of what I need to do with my repository. There is a script called git-prompt.sh which can do some nice things with your prompt, so let’s go ahead and get that. We’ll be adding a few shell scripts that get run when you open a cygwin terminal window, and I like to keep these in a bin folder inside my home folder. We’ll download the shell scripts to there:

$ cd ~
$ mkdir bin
$ cd bin
$ wget
https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh

Now edit your .bash_profile to add git command prompting to your bash sessions. The top of the git-prompt.sh file has a good explanation on the options, which are controled by environment variables.

Auto completion for git

We already installed bash-completion and now all we need to do is add a script that supplies completion functions for git. To download the scritpt:

SetupCygwin Setup Windows 10

And then to add it to your .bash_profile

Shortcuts to frequently used folders, and some other conveniences

Cygwin maps your Windows filesystem to /cygdrive/<drive letter>/ but this can be a bit tedious to get to, so I’ve created some shortcuts. You might like to break these out into a separate file if you end up with heaps of them, but I’ve only got a few for now. Open up your .bash_profile and add the following things:

[Update]
Cygwin doesn’t have cls out of the box. But with ncurses installed, you can use the commmand tput clear to do the same thing. I aliased it to cls: (thanks mikyra)

Cygwin Setup Windows 10 Ad Hoc

[Update 2]
There’s a terminal command open in OSX that is quite nice, it essentially does a shell execute on whatever you pass it. Cygwin has something similar called cygstart, but that’s not a nice name. (thanks erichui).

Cygwin Setup Windows 10 Download

I’ve also added an alias to reload my bash profile (so that later on I can edit it, and the see my changes easily).

Cygwin Ssh Setup Windows 10

Finally, I like to add that bin folder I created to the path:

Cygwin Setup Windows 10 Windows 10

Acknowledgements

Cygwin Setup Windows 10 64

  1. Taylor McGann’s blog was useful in showing me how to do a bunch of the git prompt, git completion, and fancy bash profile stuff.
  2. This StackOverflow post on apt-cyg.
  3. This StackOverflow post on clearing the screen.
  4. This StackOverflow post on cygstart.
  5. Jon L in the comments.