Как открыть pkg на mac
Перейти к содержимому

Как открыть pkg на mac

  • автор:

КАК ОТКРЫТЬ ФАЙЛ PKG НА MAC OS

Файлы с расширением .pkg на Mac OS являются пакетами установки. Они содержат необходимую информацию и файлы для установки программного обеспечения на вашем устройстве.

Чтобы открыть файл pkg на Mac OS, просто дважды щелкните на нем. Это запустит процесс установки и позволит вам следовать указаниям на экране для завершения установки.

Если двойной щелчок не работает, попробуйте щелкнуть правой кнопкой мыши на файле pkg и выберите «Открыть». Затем следуйте инструкциям, чтобы завершить установку.

В случае, если файл pkg не является пакетом установки или вызывает проблемы при открытии, возможно, потребуется использовать специальное программное обеспечение для открытия или извлечения его содержимого.

Как устанавливать сторонние программы на Mac OS? Добавление пункта Из любого источника

Unpack All Files in Packages (.pkg, .mpkg) Free on Mac

Как открыть файл dmg

Как распаковать exe файл на Mac? — Открываем exe установщик без эмуляции windows на mac m1

Как создать и удалить папку на Mac Book Pro

Как извлечь содержимое .pkg (package) файла в macOS или Windows — Pacifist — pkgutil — BetterZIP

Как установить Windows игру/приложение на Mac бесплатно (2023)

Open .dmg and .pkg — Installation — Mac OS

Чем открыть формат файла PKG?

Ошибки при установке приложений на Мак и их решения!

Installing .pkg with terminal ?

The installer command is used to install Mac OS X installer packages to a specified domain or volume. The installer command installs a single package per invocation, which is specified with the -package parameter ( -pkg is accepted as a synonym). It may be either a single package or a metapackage. In the case of the metapackage, the packages which are part of the default install will be installed unless disqualified by a package’s check tool(s).

See man installer for the full functionality. Often

sudo installer -pkg /path/to/package.pkg -target / 

is all that’s needed. The target is a «device» (see the man page for details or run installer -dominfo ). Here / is the main drive, it also accepts devices like «/Volumes/Macintosh HD» , or /dev/disk0 .

answered Nov 21, 2012 at 11:28
nohillside ♦ nohillside
99.4k 42 42 gold badges 213 213 silver badges 260 260 bronze badges

This was a workaround for installing a .pkg file that failed GUI installation with a useless «The installer encountered an error» message.

May 8, 2023 at 18:48

Just in case it’s needed; if you want to installer a .pkg without root access:

installer -pkg myapp.pkg -target CurrentUserHomeDirectory 

will install the package in ~/Applications.

answered Jun 29, 2020 at 8:15
400 2 2 silver badges 7 7 bronze badges

Is CurrentUserHomeDirectory in this case a special literal token? Or is that to be replaced with $HOME ?

Jul 11, 2020 at 5:48
@coolaj86 It’s a literal token
Jul 26, 2020 at 8:57

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do sudo installer -verbose -pkg "$f" -target / done 

As an alternative you can install the packages to your home folder with -target ~ . They will end up in /Users//Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install —cask suspicious-package ), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Handling files with spaces and special characters

While the for f in *.xyz syntax looks ‘clean’ and neat, it is considered bad practice in bash because it is likely to fail on file names with spaces, quotes and other special chars. A more foolproof approach is to use find , e.g.

sudo -i find . -iname "*.pkg" -maxdepth 1 -exec installer -verbose -pkg <> -target / \; 

Note: -maxdepth 1 forces find to only search for files in the current folder and avoid traversing the nested subfolders.

How to convert a macOS installer .pkg into an .app to run it?

I have a complete installer of El Capitan as a pkg file and I need to install it. But first I need to make it an app.
I can’t do it through the MAS because el Capitan is no longer available. Is it possible to convert a Package into an App?

234k 78 78 gold badges 420 420 silver badges 922 922 bronze badges
asked Sep 23, 2016 at 18:35
121 1 1 gold badge 1 1 silver badge 4 4 bronze badges

5 Answers 5

Whilst norcal johnny’s answer is good, it’s missing some vital steps. So here goes:

What you really want to do is:

  1. Drag your .pkg file to somewhere like Desktop if it’s still in a mounted drive
  2. If your right click doesn’t have «Show Package Contents» — Open the terminal and run: pkgutil —expand InstallMacOSX.pkg installmacosxpkg
  3. Now you have a folder called installmacosxpkg . Inside this you should see your installESD.dmg file (if it’s not there, give it a few minutes to finish extracting.
  4. Once finished, open the Distribution file in a text editor or just TextEdit.
  5. Look for the line function isSupportedPlatform() < and add return true; so it reads: function isSupportedPlatform()< return true;
  6. Now go and delete the original InstallMacOSX.pkg file.
  7. In terminal run pkgutil —flatten installmacosxpkg InstallMacOSX.pkg (this will take some time to complete, watch for the terminal command returning)

You should now be able to build install.app files on modern machines and then use that to create your bootable disks.

answered Aug 16, 2022 at 19:45
Adam Collingburn Adam Collingburn
71 1 1 silver badge 2 2 bronze badges

Worked for me, thanks! The only difference was that instead of «installESD.dmg» I had «InstallMacOSX.pkg» within «InstallMacOSX.pkg» along with Distribution and Resources. «InstallESD.dmg» was within the inner «InstallMacOSX.pkg». Tested on El Capitan.

Aug 23, 2022 at 15:47
Doesn’t work in macOS 13 which has a different directory tree.
Oct 6, 2023 at 9:04

It no longer seems possible to View Package Contents using a right click in macOS (version 10.15.7 Catalina in 2020). However you can use the pkgutil command in the Terminal to expand the .pkg file as described here:

answered Apr 17, 2021 at 21:34
21 1 1 bronze badge

Theres no need to are this an app. Here’s what to do, since the .pkg file is basically a folder (if you will), it includes the “app” that the installer runs.

I think you are wanting to burn/run the installer from a disc/USB? (if not, you can run it from the .pkg file itself by double-clicking and mounting the installer.

That being said, this is how to locate and save the .dmg file locally.

What you want to do is:

  1. Right-click on the .pkg file > select «Show Package Contents»
  2. Open the Contents/SharedSupport folder and locate the file named InstallESD.dmg.

Copy InstallESD.dmg to another directory of your choosing. This InstallESD.dmg file is what you need to burn/run macOS installer from a DVD?USB.

enter image description here

Make the OS X El Capitan Bootable Installer Drive with a Terminal Command

    Launch the Terminal application, found in /Applications/Utilities/ and enter the following command exactly (unless you changed the target volume name from ElCapInstaller to something else) onto a single line, the text will wrap because it is long, but it’s important to have proper syntax:

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/ElCapInstaller --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction 

You’ll then see the following screen text in the Terminal:

Erasing Disk: 0%… 10%… 20%… 30%…100%…

Copying installer files to disk…

Copy complete.

Making disk bootable…

Copying boot files…

Copy complete.

Done.

The target USB disk or flash drive will be erased first and then copy the files to it so that it will become a bootable OS X El Capitan installer. This can take a while to complete, so wait for the “Done” message before continuing.

When you see “Done”, that’s it, your OS X El Capitan installer drive has been created, it’s bootable, and you can use it to update as many Macs as you want to with OS X 10.11.

To boot from the installer drive, hold down the Option key during Mac system start, and select it from the startup volume menu.

Note: the OP is trying to create a bootable disc via MAS and Terminal method. In the instructions it tells you to download and save the installer, to avoid deletion after install completes and saving it for future use. It goes on to say load the .app to continue with creating the bootable disc/usb. This is why, I assume the user has worded his question as such.

I wish people would actually wait for the OP response without thumbing down prior to knowing, if indeed the answer is right or wrong. Or maybe explaining why the answer is wrong by submitting an answer or correcting a wrong one.

How can I open a .pkg file manually?

Some applications come in .pkg files, and ask for you administrator password, even if all they do is copy the binary to /Applications. I like to have my applications in ~/Applications, and I do not like to give administrative permissions to anything that is not from the mothership. Is there a way that I can manually open the .pkg file and pull out the application? There is PackageMaker in the Developer Tools, but that does not seem to do it (it did produce some output that makes me think that there really are no scripts or other pieces in the installer, just the application).

asked Jun 9, 2011 at 14:23
5,468 11 11 gold badges 37 37 silver badges 43 43 bronze badges
Jul 12, 2012 at 11:51

9 Answers 9

If you right click it, and click Show Package Contents you’ll get a few files in a Contents folder. (Note: if you do not see Show Package Contents you will need to open Terminal.app and run pkgutil —expand mystubbornpackage.pkg path/to/expand )

One is a BOM file (bill of materials) which gets turned into a receipt that you can use to uninstall the app. This file contains a manifest of everything the package will install and where to; to read this file, use the lsbom command.

Most packages (I’m using Office 2008 here) also have an Archive.pax.gz file, this contains everything that Installer will move into the various folders as instructed in the BOM file. Most apps seem to have the .app in this archive, although dragging that to /Applications might leave it without frameworks it needs to run; so you’ll have to figure out which other files it needs and where it needs them to get it to work.

Additionally, all packages can log messages, if you hit Cmd-L (or choose the Installer Log option from the Window menu, you can view them as they’re generated. This might give you an idea what extra things it’s installing, at the very least it’s some more information if you’re untrusting of the package.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *