Home > Wiki Tips

What's PKG File on Mac? Open, Install, Extract, Delete PKG File on Mac

Updated on Tuesday, December 3, 2024

Written by

Jenny Zeng

Approved by

Jessica Shee

English Français Deutsch やまと Español Português

Summary: In this article from iBoysoft, we'll discuss what a pkg file on Mac is, and how to open, install or delete it. If your pkg file isn't opening or installing, give the methods a try.

Sometimes when you download an app installer, it comes with the .pkg format. To install the application, you'll have to extract the package. If you're unable to open or install .pkg files on Mac, this post is for you. We'll also explain what a .pkg file is and how to create or delete a pkg file on Mac.

What is .pkg file on Mac?

A .pkg file is a package installer file used to distribute software. It often contains application files, scripts, libraries, or additional helper tools or resources the app needs to run. For instance, if you download the macOS Sequoia installer from Mr Macintosh, you'll get the full installer pkg file named InstallAssistant.pkg.

How to open pkg file on Mac?

Here are two ways to view the contents of a pkg file on Mac. (If by opening, you mean installing the software dwelled inside the pkg file, jump to the next section.)

① Open pkg file in Finder

  1. Right-click on the pkg file.
  2. From the context menu, choose "Show Package Contents."
  3. Open the Contents folder to view the contents.

② Extract pkg file in Mac Terminal

If there's no option "Show Package Contents," the pkg file was created as a flat file. You can right-click on the package and choose "Get Info" to confirm its kind. If it is, you'll see "Installer flat package." In this case, you can expand the pkg file in Terminal.

  1. Open Finder, then browse to Applications > Utilities and launch Terminal.
  2. Run the following command.cd ~/Desktop && xar -xvf /path/to/pkg

To extract the pkg file in Terminal, type cd ~/Desktop && xar -xvf, leave a space, then drag and drop the pkg file into Terminal and hit Enter. The command may look like: cd ~/Desktop && xar -xvf /Users/jenny/Desktop/Desktop/Desktop\ -\ Jenny's\ MacBook\ Air/Desktop/InstallAssistant.pkg

After the command is executed, check your desktop to view the expanded contents.

Share the methods to benefit others who want to expand pkg file on Mac!

 

How to install pkg file manually on Mac?

If you want to install the pkg file on Mac, choose one of the following ways.

① Run pkg file on Mac manually

  1. Double-click on the pkg file to open the installer. (If it won't open, temporarily bypass Gatekeeper on Mac by right-clicking on it and choosing Open.)
  2. Follow the instructions to select an install location and install the app.

.pkg file not installing on Mac?

Suppose the pkg file won't install on Mac but fails with the error message "An error occurred during installation. The installation failed. The installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance." Then you can fix it by moving the pkg file to a different folder.

For instance, if the file is in your Downloads folder, transfer it to your Desktop and install it again.

② Install pkg file in Mac Terminal

  1. Open Terminal from the Applications/Utilities folder.
  2. Execute the command below.sudo installer -pkg path/to/pkg -target /Type sudo installer -pkg, leave a space, then drag and drop the pkg file into Terminal, leave another space and input -target / and press Enter.
  3. Type your admin password and press Enter.

Share the steps on how to run pkg files on Mac with your friends!

 

How to delete pkg files on Mac?

You're probably wondering whether you should keep or delete the .pkg file on Mac after the application is installed. We usually recommend you delete the pkg file on Mac to save space. This won't affect the installed software if that's your concern. Simply drag and drop the pkg file into the Trash to delete it.