Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6 Server: Set the appropriate Software Update Server OS X Server
Snow Leopard only hintWith Mac OS X Server 10.5 and below, Software Update Server only had one catalog of updates -- thus, you could run a command like this one, and have it point Software Update to your server:

defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL "http://Server.local:8088/"

With Mac OS X Server 10.6, Apple has divided the catalog file into three separate catalogs: one for 10.4, one for 10.5, and one for 10.6. Each is a separate URL, and if you set the wrong catalog for the OS, you'll get the (incorrect) message that your software is already up-to-date. Having three separate scripts is a hassle, though, and is prone to error.

On the Hints Forums, users tw and Hal Itosis were instrumental in crafting this AppleScript. It checks the OS that you're currently running, and sets the appropriate Software Update Server URL. Change Server.local to your server's address.

Bonus hint! Here are a couple of AppleScripts for checking which server is currently set, as well as setting the server back to the default (Apple's). First, to check the current server, use this AppleScript:

set SUServer to do shell script "defaults read /Library/Preferences/com.apple.SoftwareUpdate CatalogURL" display dialog SUServer

And use this AppleScript to reset the Software Update Server:

do shell script "defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"

Save them as applications, and you can quickly launch them from a flash drive or a network share.

I should note that I realize Workgroup Manager is the official way of pushing the Software Update Server. I work at a Mac repair shop, though, and binding to a directory is not only way overkill for our needs, but introduces all kinds of complications. This is a quick way to update someone's machine without having to download each update via Apple's servers, or install each package manually.

Hope this helps someone!

[robg adds: I haven't tested this one.]
    •    
  • Currently 2.93 / 5
  You rated: 3 / 5 (29 votes cast)
 
[46,833 views]  

10.6 Server: Set the appropriate Software Update Server | 10 comments | Create New Account
Click here to return to the '10.6 Server: Set the appropriate Software Update Server' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6 Server: Set the appropriate Software Update Server
Authored by: jcbeckman on Oct 21, '09 08:34:13AM

The different catalogs are listed in the manual for Software Update, as well as the commands for setting the catalog via the terminal in unmanaged clients. Lots of good info in that manual.



[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: flammable on Oct 23, '09 12:27:07AM

True, the commands and URLs are in the manual. You're missing the point of the hint if you think that's adequate, though.

The strength of this hint is the AppleScript. It allows you to run the same script on all types of machines, without first needing to check which OS version you're running. There is no error message if you choose the wrong catalog, so having three separate scripts can be problematic.



[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: feyd on Nov 09, '09 10:07:36AM
Awesome hint. I actually tried deploying this using Casper by JAMF. Every once in a while it would fail and the log stated that there was a missing ">" somewhere. Obviously there are no brackets in your script. To avoid the issue I rewrote it as a bash script.
#!/bin/bash

#script ported from AppleScript to shell by feyd
#original by flammable found here http://www.macosxhints.com/article.php?story=20091002190708159

osVersion=`sw_vers -productVersion`

case $osVersion in
10.4*)
	catalogURLValue="http://Server.local:8088/index.sucatalog"
	;;
10.5*)
	catalogURLValue="http://Server.local:8088/index-leopard.merged-1.sucatalog"
	;;
10.6*)
	catalogURLValue="http://Server.local:8088/index-leopard-snowleopard.merged-1.sucatalog"
	;;
10.[1-3]*)
	exit 1
	;;
esac

defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL $catalogURLValue

exit 0
Thanks again!

[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: flammable on Feb 27, '10 07:33:15PM

Wow, that's awesome! Thanks for sharing your rewrite!



[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: willowhaus on Apr 01, '10 12:41:14PM

Thank you so much for this - your script helped me solve my problem after migrating from Server 10.5 to Server 10.6. Awesome!



[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: yogiberra on Nov 13, '09 01:46:02AM

Hi,

I'm a complete Applescript newbie and I can't get this script (the one that checks the server) to work.
Get the following error message in Applescript:

error "dyld: shared cached file was build against a different libSystem.dylib, ignoring cache
dyld: shared cached file was build against a different libSystem.dylib, ignoring cache
2009-11-13 10:40:06.733 defaults[349:60f]
The domain/default pair of (com.apple.SoftwareUpdate, CatalogURL) does not exist" number 1

What do I do wrong?
First I just tried to copy and paste the string but it wouldn't compile, then i put "display dialog SUServer" on a different line and got the above error message.
I'm running 10.6.2.

Cheers
Bjorn



[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: flammable on Feb 27, '10 07:32:01PM

Hi! Sorry about the very late reply...but this is actually the expected result:

2009-11-13 10:40:06.733 defaults[349:60f]
The domain/default pair of (com.apple.SoftwareUpdate, CatalogURL) does not exist"

if your Software Update Server is set to Apple's. If you had another Software Update Server set, it would display the URL (I'm something of an AppleScript newbie myself, otherwise I'd write something that outputs a better error message.). I'm not sure why you're getting this error:

error "dyld: shared cached file was build against a different libSystem.dylib, ignoring cache
dyld: shared cached file was build against a different libSystem.dylib, ignoring cache



[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: flammable on Mar 13, '10 09:33:30PM

Looking again, it appears something got mangled when the hint was published. This is how to check the current Software Update server:

set SUServer to do shell script "defaults read /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
display dialog SUServer



[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: flammable on Apr 03, '10 12:35:05PM
FYI: Apple has an excellent KBase article now, detailing a portion of this hint and more:

http://support.apple.com/kb/HT4069

[ Reply to This | # ]
10.6 Server: Set the appropriate Software Update Server
Authored by: flammable on Mar 21, '11 09:53:49PM

And with Mac OS X Server 10.6.7, they can all use the same URL (see the article linked above, it's been updated). Awesome!



[ Reply to This | # ]