Getting errors when trying to unpack a .pkg from Apple

Discussion in 'Mac Basics and Help' started by corko, Dec 4, 2018.

  1. corko macrumors newbie

    Joined:
    Jul 29, 2016
    Location:
    none
    #1
    All right, I'm coming back to this problem after a long absence. I apologize to
    Fishrrman for not responding in that thread, but the last suggestion didn't work and I decided to shelve this for a while. And then I didn't want to necro the thread.

    The short version: my MacBook had a HD failure and I've been trying to reinstall the OS onto the new hard drive with no success. I think that doing this via a bootable USB drive is the only practical option, so I've been downloading different versions of OSX and trying to turn those into bootable drives. Most recently I found this list of pkg files, available directly from Apple. This seems ideal, but I've downloaded several of these and I can't extract any of them. If I use xar ("xar -xf foo"), in the recovery Mac terminal or in Linux, I get: "error opening xar archive."

    If I use pkgutil ("pkgutil --expand foo /bar"), I get: "Could not open package for expansion: foo"

    If I use 7z ("7z x foo"), I get told that it's actually a gzip archive and that "There are data after the end of the archive"

    I've done this with several of the pkg files now, and gotten the same results, and I've verified the sha and md5 sums as far as I've been able to. (I only have checksums for one of the pkg files, but that one was good and gives the same errors.)

    So I'm assuming that not all of these pkg files are corrupt, I'm just not using them correctly. Maybe there's some utility that I could use to expand them? Or convert them? Or repair them? Does anyone have any suggestions?
     
  2. jtara macrumors 65816

    Joined:
    Mar 23, 2009
    #2
    Obtain the use of another Mac, and just follow the procedure to make a bootable installer.

    https://support.apple.com/en-us/HT201372

    It's linked from the Github repo you cited.

    I'd put it on a thumb drive. (Not sure if that's what you meant by "bootable USB Drive".)

    You won't need the other Mac to install - just to make the thumb drive.

    No idea what the purpose of that Github repo is, or what those files actually are. Just follow the Apple article and download from one of the links in the article.

    Or just use network recovery and forget all this.

    I used to make installer USB sticks. I don't bother any more. Gigabit connection from Google Fiber (Webpass).
     
  3. DeltaMac macrumors G3

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #3
    Those .pkg files are used by the Apple software installer. No need to "extract" anything manually. All you would need to do is double-click on those .pkg files, and they should install on a Mac.
    The bootable installer for your Mac would need to be created on another Mac...

    Did you ever get the new HD formatted? You won't be able to install a new system unless you have the HD in an Apple format. You can easily do that by booting to Internet recovery, where you can open the Disk Utility, then erase the drive. Make sure the format is set for Mac OS Extended (journaled), and partition scheme is GUID. You may have already done that...
     
  4. corko thread starter macrumors newbie

    Joined:
    Jul 29, 2016
    Location:
    none
    #4
    Sorry, I didn't give all the details because I didn't want to make the question too long, but: I don't have access to another Mac. My Macbook does boot into recovery (but the installer there doesn't work) so I can use disk utility and I can run things in the terminal and that's all. I also have a Linux PC, which I can use for other things. Between the two of these I need to come up with a way to make this work.

    I want to expand the pkg files because I can use the InstallESD.dmg files inside them to make a boot drive (yes, I did mean a USB thumb drive).

    I have formatted the hard drive, but I haven't been able to reach the point where that matters. I have also formatted the USB drive (many times), for what that's worth.

    I have also tried using pirated copies of OSX. This is how I resolved this problem the first time I had it, because piracy makes things easier. I acquired and installed a pirated copy, and then I used that to make an Apple account and download an official copy of OSX, and then I wiped the drive and installed the official copy. However... it hasn't worked out this time. I can't find a pirated copy which will install successfully.

    And, of course, all things being equal I'd prefer not to use a pirated copy. So the pkg files from Apple seem to be ideal, I just can't open them.
     
  5. DeltaMac macrumors G3

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #5
    What does that mean - "the installer there doesn't work"? Might be a good thing to give us some other information about what happens.
    Do you mean that you get an error message (what message is it?)
    Or, you can't install because the system locks up, or it appears to install, but won't restart to complete the install?
    Or, the install appears to finish, but you can't set up a new user?
    Or, some other detail that appears to stop the install?

    That is after booting to Internet Recovery (where you see the spinning globe, NOT the usual Apple icon?)
    Finally --- Is there anything unusual about your internet connection (which you need when using Internet Recovery), such as needing to use a proxy server (something often used at schools or businesses).
    Are you using a wifi network, or connecting through a wired/ethernet connection?
    --- Post Merged, Dec 5, 2018 at 12:14 PM ---
    If you have found a "pirated" copy and used that once to install OS X - why not just use that same copy? Once you get it installed, you can then go from there to upgrade the system, if you choose to do that.
     
  6. corko thread starter macrumors newbie

    Joined:
    Jul 29, 2016
    Location:
    none
    #6
    If you really want all the details you can have a look here (this is the same thread that I linked at the top). The answer there was that internet recovery was rolled out over time, and that it doesn't work right on some models made during the transition period.

    I can't use the same pirated copy that I had before because I don't have it anymore. After I used it to get an official version from Apple I deleted it, thinking that I wouldn't need it again. Then the HD failed and the official version didn't work, etc. So here I am trying to unpack these pkg files.

    Is there anything special about pkg files that are handled internally by Apple's software?
     
  7. DeltaMac macrumors G3

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #7
    The Mac installer uses those .pkg files directly. There is no need to "unpack" those files manually.

    Link to get the Sierra installer (if that's the version you want)
    (I'm pretty sure that you have to do the download on a Mac, and likely a fairly recent system. That page linked says you need a Mac running High Sierra or newer, but you can try it on whatever you can find, I suppose.
    Problem remains: you have nothing when the only drive you have is erased/blank, and nothing else backed up (like an installer for the system), or no OS X installer on DVD, or no external USB with the installer.
    You CAN purchase OS X installers, already on bootable thumb drives, just search on Ebay, or there's also some on Amazon.
    You're kinda SOL without another Mac to use for the download and prep for the installer. It's NOT simple, nor reliable to do it from Windows, for example.

    You can also ask about this at an Apple store, particularly about making a USB installer. The store may help you with that.
     
  8. corko thread starter macrumors newbie

    Joined:
    Jul 29, 2016
    Location:
    none
    #8
    Okay, ::whew:: I got it. Finally got one of the pirated copies to work, then downed a legit copy, etc. I'm keeping several backups this time.

    Thanks for the help.
     

Share This Page