Updating Cygwin (2015)

Cygwin doesn’t automatically update itself, and doesn’t provide a command line utility to do so. In order to get updates, and install or remove software, you need to run the installer again. Occasionally, you will also need to get an updated copy of the installer. Fortunately, all this can be automated:

The option I use is to create a small bash script which checks www.cygwin.com to see if there is a newer setup file, download it if there is an update, and then run it, with a few parameters that stop it from creating a dozen shortcuts on your desktop, etc. Thanks to the functionality of wget (which you’ll have to install) this is as simple as:

The script downloads a copy of the setup executable to your /usr/local/bin directory, which is the correct place for locally installed programs of this sort. I’d recommend putting this script in that directory too, then making sure it’s in your path variable so that you can run it.

Alternately, there is a command line installer, much like Debian’s apt-get, called apt-cyg, which has now moved off Google Code, onto Github. It allows you to install or remove new packages from the command line, which is neat, but it’s one fatal flaw is that it doesn’t have a command which allows you to scan the installed packages for available updates, so it won’t remove your need to use the original setup program. You can install it with the following commands: