Skip to content

Instantly share code, notes, and snippets.

@merrilymeredith
Last active March 8, 2017 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merrilymeredith/dac56977fa5a41db6854d356113953d3 to your computer and use it in GitHub Desktop.
Save merrilymeredith/dac56977fa5a41db6854d356113953d3 to your computer and use it in GitHub Desktop.
Updating babun cygwin packages

Babun has a cool package manager, but pact doesn't offer the equivalent of apt upgrade because you can't really update Cygwin files on Windows while Cygwin is running. Babun's core and plugins update very occasionally but sometimes you want to upgrade all your Cygwin packages at once. This is the script I use to do just that. All it's really doing is downloading Cygwin's setup-x86.exe and running it, and you can do the same manually. I just didn't see this procedure clearly documented anywhere for folks who were sold babun as an easy-to-use Cygwin kit. The only hits are "upgrade one at a time" or "use this command to sorta brute-force it all."

This upgrades everything in one shot.

Notes:

  • Remember you have to stop all Cygwin processes!
  • Yes, babun only installs 32-bit, as of release 1.2.0
  • Script does not check the PGP signature of this EXE before running it
  • Modern PowerShell makes you explicitly enable running scripts so you are sure what you're doing.
    1. Ignore any search results that tell you to enable scripts globally.
    2. Open PowerShell
    3. Set-ExecutionPolicy Unrestricted -Scope Process
    4. .\update-babun.ps1
$tempdir = New-TemporaryFile | %{rm $_; mkdir $_}
pushd $tempdir
iwr -Outfile "setup-x86.exe" "https://cygwin.com/setup-x86.exe"
.\setup-x86.exe -Bgnq -R "$env:USERPROFILE\.babun\cygwin" -l "$tempdir" | Out-String
popd
rm -Recurse -Force $tempdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment