Sub topic 3
Installing from Disk Images and Installer Packages
Assume you know Finder, the Applications folder, and the difference between .dmg and .pkg files. The key question is whether the source and installer deserve your trust.
Installing `.dmg` and `.pkg` files
A disk image (.dmg) is a container that macOS mounts like a temporary disk. Open it, drag the app to Applications, eject the image, and keep or delete the downloaded file. Do not run an app directly from the mounted image.
An installer package (.pkg) runs an installation program. It may copy files outside Applications, install helper tools, or request an administrator password. Read the installer’s identity and prompts before continuing.
# Check a package before opening it
pkgutil --check-signature ~/Downloads/Example.pkg
# Check an installed app's signature
codesign --verify --deep --strict --verbose=2 /Applications/Example.app| Format | Typical action | Main caution |
|---|---|---|
| `.dmg` | Drag the app to Applications | The app may still be untrusted |
| `.pkg` | Follow the installer | It can change more of the system |
> callout warning > Never disable Gatekeeper globally to install one blocked app. A block can indicate an unsigned, modified, malicious, or simply outdated application.
When Gatekeeper blocks an app
First, confirm that you downloaded the app from the developer’s real site. Check its signature with codesign and its policy assessment with spctl. If both the source and identity are trustworthy, open System Settings > Privacy & Security and use Open Anyway only when you understand the risk. Otherwise, remove the download.
Permissions, updates, and removal
Review System Settings > Privacy & Security. Check permissions such as Files and Folders, Full Disk Access, Camera, Microphone, and Accessibility. Revoke access an app no longer needs.
Update through the Mac App Store, the vendor’s updater, or the same package source you used originally. Avoid update pop-ups from unrelated websites.
To remove an app, use its vendor uninstaller when provided. Otherwise quit it, move it from Applications to the Trash, and remove only documented support files. Do not delete shared files merely because their names are unfamiliar.
Homebrew casks
Homebrew casks offer a command-line alternative for many graphical apps:
brew install --cask example
brew update
brew upgrade --cask example
brew uninstall --cask exampleHomebrew simplifies repeatable installs, but it is not the Mac App Store. Review the cask and confirm that it points to the expected vendor.
Exercise
Gatekeeper blocks an app downloaded from a search-ad result. What should you do?
Show answer
Do not bypass the warning. Delete it or redownload from the verified developer site, then check its signature before considering installation.