Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract from DMG

Tags:

macos

dmg

extract

How to extract content of DMG without mounting it? I want add autoupdate system to my application. It downloads DMG from website, then extract new version of application from it.

like image 497
Henry Manister Avatar asked Jul 26 '12 23:07

Henry Manister


People also ask

How extract DMG file in Linux?

Just use 7z x . In the case of for example Sublime text, 7z x "Sublime Text 2.0. 2. dmg" will be enough to extract all the files.

What is DMG Extractor?

DMG Backup Extractor allows Windows users to open Apple Mac . DMG disc image files and extract the files within to their Windows PC. Simple to use, and extremely useful - DMG File Extractor can open any DMG file created on an Apple Mac and extract the files content to Windows compatible file formats.


1 Answers

Some .dmg files can be extracted by using 7-zip.

$ 7z x your.dmg
$ ls
your.dmg
0.MBR
1.Primary GPT Header
2.Primary GPT Table
3.free
4.hfs
5.free
6.Backup GPT Table
7.Backup GPT Header

...and after extracted the 4.hfs file:

$ 7z x 4.hfs

...you'll get the content of the .dmg file.

You could also mount the .dmg in Mac OS X using hdiutil command (which is also used by Homebrew Cask).

Please refer to this Ask Ubuntu question for more use cases on Linux.

like image 200
Mengdi Gao Avatar answered Nov 07 '22 04:11

Mengdi Gao