My mother needed the latest version of Flash to view a web page. I decided this was a good opportunity to install the package from the command line over secure shell. She has a PowerMac G4 running Mac OS X 10.4. It turns out that the update didn’t work, but I relearned a bit about some useful command line tools for Mac OS X. I always start in the temp directory. Then I downloaded the installer and unzipped it. That’s all pretty straightforward.
cd /tmp/ curl -O http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_osx_ub.dmg.zip unzip install_flash_player_osx_ub.dmg.zip
Next, I used “hdiutil” to mount the disk image and then changed to that directory.
hdiutil attach Install\ Flash\ Player\ 10\ UB.dmg cd /Volumes/Install\ Flash\ Player\ 10\ UB/
Then I used “installer” to install the package specifying the package with “-pkg Adobe\ Flash\ Player.pkg” and the target volume with “-target /”.
installer -verbose -pkg Adobe\ Flash\ Player.pkg -target /
It will run through the installation and output some information. After that, I changed back to the temp directory. I initially tried using “umount” to unmount the disk image, but that is a bad idea because it doesn’t fully unmount the image. The better approach is to use the “hdiutil” again. I find the volume to unmount by using the “df” command. Once it is unmounted, I deleted the zip file and the disk image.
cd /tmp/ hdiutil detach $(df | grep Flash | awk '{print $1}') rm install_flash_player_osx_ub.dmg.zip rm Install\ Flash\ Player\ 10\ UB.dmg
Most applications for Mac OS X come in disk images, and many of those have package installers. This is a quick way to install software on a remote Macintosh or a way to automate installations with scripts.