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

Check software update status at Terminal launch OS X Server
This tip can be nice for those that doesen't have remote GUI control over their computer. Add this line to your .profile file, in your home directory:
softwareupdate --list
When you log in, you'll see:
Welcome to Darwin!
Software Update Tool
Copyright 2002-2003 Apple Computer, Inc.

Your software is up to date.
www:~
To install an update if softwareupdate finds out-of-date packages, type softwareupdate -install packagename

The only drawback is that it will run each time you open the terminal, locally or remotely. Alternatively you can just run the command in the shell if it gets too annoying. Works on both 10.3 server and client. For further description of this tool, type man softwareupdate.

[robg adds: We covered the basic softwareupdate command in an earlier hint ... this hint works just fine on non-server, too. i ]
    •    
  • Currently 1.75 / 5
  You rated: 4 / 5 (8 votes cast)
 
[10,615 views]  

Check software update status at Terminal launch | 6 comments | Create New Account
Click here to return to the 'Check software update status at Terminal launch' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Check software update status at Terminal launch
Authored by: vondrix on Feb 13, '04 01:21:30PM
Instead of doing
softwareupdate -install packagename
you can just do
softwareupdate -i -a
to install all software updates available.

[ Reply to This | # ]
Check software update status at Terminal launch
Authored by: crispyking on Feb 13, '04 02:33:13PM

You can also download the packages and install them separately using installer(8). Useful if you have more than one Mac to install them on and don't want to download them multiple times and/or need to install them remotely.

Here's the process I use (for 10.3):

1. softwareupdate -l
- do this on each computer (in case of per-machine firmware updates).
- note which updates need reboot, etc.
2. softwareupdate -d <name> # download package called <name>
- repeat for all packages you need
3. Move the packages to a network-mounted folder if necessary:
mv /tmp/${uid}/TemporaryItems/com.apple.SoftwareUpdate/* \
/Network/Library/Packages
# ${uid} is the uid of the user that did the download
4. Check that all packages should be installed in /:
cd /Network/Library/Packages
foreach p ( *.pkg )
echo $p
installer -volinfo -pkg "$p"
end
- the above is for (t)csh; if you use (ba)sh, you'll need to modify it.
5. Search for COMMAND_LINE_INSTALL:
egrep COMMAND_LINE_INSTALL `find . -type f`
-- Figure out which ones shouldn't be done via the cmd line (!)
6 Install them with:
installer -verbose -pkg <pkg_name> -target /
(reboot if the update requires it).




[ Reply to This | # ]
Check software update status at Terminal launch
Authored by: Mattias Hedman on Feb 14, '04 05:16:13AM

There is a problem doing this via the terminal. If a update requiers a interaction from the GUI it will seem like the process has stopped at the terminal you're sitting at.

One of these updates is Quicktime. I tried to update an Xserve from remote just to discover that I thought that the machine frooze. When it actually was waiting for me to push "Continue" on the server screen...

So keep this in mind when doing this.

It actually works when the GUI Software doesn't. That is good!



[ Reply to This | # ]
Check software update status at Terminal launch
Authored by: bustthis on Feb 17, '04 03:37:08PM

warning: this will break sftp!!!

i was having problems using sftp in transmit, fugu and terminal after adding softwareupdate --list to my .tcshrc file. once i removed it, sftp works again.


---
charles



[ Reply to This | # ]
Check software update status at Terminal launch
Authored by: LC on Feb 17, '04 04:41:37PM

Did you make sure (in your ~/.cshrc) to exit early for non-interactive shells?
Many apps trigger a subshell (I remember Unixes where this used to happen on a
"which" command;), which is non-interactive, just to do something basic so in that case,
you want to exit after the env setup i.e. just after path/PATH initialization (and any
other env variable initialization)
So ... what if we try --
if (! ?{prompt}) exit
prior to this Software Update stuff; Larry.



[ Reply to This | # ]
Check software update status at Terminal launch
Authored by: LC on Feb 17, '04 04:45:21PM

Sorry, I just realized that the original thread was assuming sh/bash (the ~/.profile) ...
I think it's safer to do the Software Update check as a backgrounded sub-shell, but
anyways I wouldn't put it in a ~/.tcshrc if tcsh is always launched by default (unless you do
the interactive i.e. prompt check like I mentioned) Larry.



[ Reply to This | # ]