The trick to unpack a .pkg file on MacOS

unpack pkg file

Even though the AppStore is mostly used to download programs on Mac OS today, there is still a good base of software that continues to be downloaded in installable packages, but if you are a fan of customization and programming, you may want to unpack a . pkg.

Do you want to know more about .pkg packages? We will teach you all about them in this article.

What is a .pkg package?

A .pkg file is a type of file used primarily on macOS operating systems, which used to distribute and install software on Mac, that is, it is a compressed file that contains a series of components necessary to install an application or a software package on a macOS system.

These components typically include binaries, installation scripts, resources, libraries, and metadata that describe the application or package. To put a simile, it would be like the .EXE or .MSI files of Windows.

When we run a .pkg file, it will open the macOS installer, which will extract the contents of the package and place them in the appropriate locations on the system through the package's own guided process.

Why we may need to unpack a .pkg file?

Although unpacking a .pkg file is not necessary, it is possible that for some reason we may want to do it:

- Learn how the program works that we want to install and be able to extract files from it that may interest us.
- Customize the software we want to install, removing some unwanted feature.
- solve some problem that may be in the installation package.
- Install certain components of a program, but not the program itself.

Although .pkg is a MacOS standard, there are tools and methods available to unpack and work with these files on different operating systems like Windows or Linux if we wanted to. Let's now see how these files are unpacked on the three operating systems.

How to unpack a .pkg file on MacOS?

There are two different ways to unpack a .pkg file. One more manual, dedicated to more advanced users and another with a very easy-to-use graphic tool. Let's see both.

Use Terminal, our command console

unpack pkg with mac terminal

The first method is the native one of macOS, which includes using the command console and a medium level for managing our operating system.

To do so, you can follow the steps below:

  • Open Terminal from the folder Profit Share in Applications
  • Navigate to the location where the .pkg file is located using the cd command followed by the folder path.
  • Use the command xar -xf file_name.pkg to extract the contents of the .pkg file. Remember that you must replace file_name.pkg with the actual name of the .pkg file you are wanting to unpack.
  • And voila, with this you will have unzipped your .pkg file in the directory where you have it stored.

Use the unpkg utility: a fast and efficient assistant

UNPKG helps to unpack pkg

unpkg is a tool developed by Tim Doug that is in charge of making all that manual process that we have mentioned previously simple.

This tool provides a simple and easy to use interface to extract the contents of .pkg files without the need to use command line tools or additional software.

The great advantage of this program, without a doubt, is its simplicity: any user regardless of their level can be able to use it to unpack .pkg files, without further complication.

To use unpkg, follow these steps:

  • Drag the file that you want to unpack to the tool itself.
  • Once you have selected the .pkg file, the unpacking process will start automatically.
  • At the end of the process, unpkg will show you the contents of the package, including all the files and folders it contains.

It's important to know that unpkg only supports macOS .pkg files and it does not work with other package formats or compressed files, but without a doubt, due to its ease of use, it is the tool that we recommend since SoydeMac to unpack pkg files.

Can we unpack a .pkg file from Windows?

7zip unpacks pkg files

Although Unpkg is only available for macOS, Windows users will be in luck as one of the most popular compression programs, 7zip, is compatible with this type of files.
7zip is a program created to unzip files that is compatible with many existing extensions, including the .pkg format natively.

This implies that to unzip the program, you simply have to press the right button and hit Unzip with 7zip and that's it, the program will take care of doing everything automatically.

One of the strengths of 7zip is that it is free software: it can be downloaded for free from the developer's website and you do not have to pay any license for its use, something that does not happen with popular paid Windows alternatives such as WinZIP or WinRAR .

I want to unpack a .pkg from Linux

unpack pkg file on linux

As noted above, Linux users also have the ability to unpack .pkg files without having to resort to macOS, in much the same way as described for Mac.

The first option is to take advantage of the Linux Terminal, which works much like the Mac Terminal, but installing a program via the command line: pkg2zip

We are going to use as an example an installation through Apt-get oriented to systems based on Debian or Ubuntu, although if you have another distribution you can adapt this step to your available installation manager:

  • First of all, install the program using the command: sudo apt-get install pkg2zip.
  • Once installed, navigate using the command cd to folder where our .pkg is hosted
  • Run the following command to unzip it: pkg2zip file_name.pkg, substituting file name for our package.

And with this we would conclude our brief tutorial on how to unzip .pkg files in our most common operating systems: macOS, Windows and Linux.

It is important that, when decompressing it, you take special care with the files that are inside: a bad modification could leave the file unusable and it cannot be installed correctly.

Although if this happens to you, don't worry: you can always download that program from the internet again and try again to modify it until you can leave it to your liking and perfectly functional.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   L said

    Please check this article, it looks like Unpack is malicious. Do not download.

    https://news.ycombinator.com/item?id=14111499