Can't download OS X Mavericks
A few initial tips/suggestions/thoughts


The random guy at &#8216;Power Mac Center&#8217; was close. It’s not the speed of the internet that matters, it’s the combination of: A) the speed at which Apple sends the files, and B) the bandwidth capabilities of your connection. In my experience &#8220;A&#8221; never comes close to &#8220;B&#8221;.
Large downloads from the Mac App Store should be resumable, but for some reason they often aren&#8217;t. You can pause them for awhile, but if you pause it for too long, it always seems to start over.
Someone told me that their download speeds from the iTunes Store varied greatly depending on which DNS servers they were using. I don&#8217;t pretend to know why that would be the case, but he said that it made a great deal of difference in his experience. So if you are using your ISP&#8217;s DNS servers, you might try OpenDNS or Google DNS and see if that helps.


The excruciatingly long and nerdy answer that just might help. But no promises.

GUI progress meters are often not very helpful. If you want the real scoop on what is happening, you&#8217;ll want to get down into the place where the actual files are being downloaded.

In this case, that&#8217;s (somewhere under) /var/folders/.[1] 

Now, you could try to do this in Finder, but really, you&#8217;d be much better off firing up Terminal.app from /Applications/Utilities/. Then you can copy/paste this command:

find /var/folders -ipath '*/com.apple.appstore/*' \
-name manifest.plist 2&gt;/dev/null


Note that you can copy that command as two lines as long as the first line ends with \ or just remove the \ and keep it as one long line.

Translated into English, that command says &#8220;Look in the folder /var/folders/ for any file called &#8221;manifest.plist&#8220; in a path (series of folders/directories) that has &#8221;com.apple.appstore&quot; in it.

For example, on my computer right now (with no active Mac App Store downloads), I have only one of these, which is at:

/var/folders/bk/cb9y7rbx30q_6n40wp096grc0000gn/C/com.apple.appstore/manifest.plist


Once you find that plist file, you need to look inside it for the name of the &#8216;package file&#8217; which is being downloaded from the Mac App Store.

Usually that file will end with &#8220;.pkg&#8221; so if you wanted to skip a step, you could try just looking for .pkg files:

find /var/folders \
-ipath '*/com.apple.appstore/*' \
-iname '*.pkg' \
-ls 2&gt;/dev/null |\
egrep '\.pkg$'


This is a similar command as before, except that now we are asking find to look for any files which end with &#8216;.pkg&#8217; and then show us the output of ls on any matching file or folder.

If you track the file size of any &#8216;.pkg&#8217; files found in that directory, then you can see how much data has been downloaded. 

Example: Since I don&#8217;t have any downloads currently, I don&#8217;t have any .pkg files to show, so I&#8217;ll use a &#8216;.plist&#8217; file for this example. Here&#8217;s what the output of that command would look like for me:

4446464 8 -rw-r&#8211;r&#8211; 1 luomat staff 226 Dec 3 01:03 /var/folders/bk/cb9y7rbx30q_6n40wp096grc0000gn/C/com.apple.appstore/manifest.plist

Most of the stuff on that line we don&#8217;t care about. You can probably pick out the date &#8220;Dec 3&#8221; and the time &#8220;01:03&#8221; but actually the only part we really care about is the size of the file, in bytes, which is the number just before the date: 226. 

(Just stay with me here.)

If you count the number of &#8216;columns&#8217; in that line, you&#8217;ll find that the &#8216;226&#8217; is the 7th column, and the filename is the last column. Using another Unix tool called awk we can run that command again and only see the fields that we want to see: the file size and the file name.

find /var/folders \
-ipath '*/com.apple.appstore/*' \
-iname '*.plist' \
-ls 2&gt;/dev/null |\
awk '{print $7&quot; &quot;$NF}'  


Again, from top to bottom, that says: (1) look in /var/folders (2) for anything in a path of folders/directories which contains &#8216;/com.apple.appstore/&#8217; (3) and files which end in &#8216;.plist&#8217; (which you&#8217;d want to change to &#8216;.pkg&#8217;)
and then (4) show us the file listing (ls) output for anything that matches, and filter (|) the results through (5) awk and print out only: the 7th column, a space (that&#8217;s the &#8220; &#8221;) and the last column ($NF means &#8216;last&#8217; to awk).

Whew! Ok, did you get all that? I hope so. If not, don&#8217;t give up yet. There&#8217;s a surprise at the end of this post. I&#8217;ll stop with the details there, but just imagine if you ran a loop which kept checking the size of that .pkg file every, oh, 15 seconds or so. Then you would be able to see how many bytes had been downloaded, and if you kept the old value and compared it to the new value, you could even tell how much of the file you had downloaded since the last time you checked.

But what! There&#8217;s more! In that manifest.plist file that I mentioned before, not only does it give us the name of the .pkg file that is being downloaded, it also tells us how many bytes it is supposed to be.

So, if you really wanted to, you could:


Look for the manifest.plist file
Find the name of the .pkg file that the manifest.plist said we were currently downloading
Find the total size that .pkg file is supposed to be when it has completely downloaded
Run a loop as long as that .pkg file exists, checking its size, comparing that to the previous size, and the total size, and give you an idea of how much has been downloaded, how fast it is being downloaded, and how much more there is to go.


Wow. Doesn&#8217;t that sound fün?

Well, I have some good news. These sorts of tedious tasks are just the sort of thing computers are really good at doing. All you need is someone who tells the computer what to do, and put it together in some kind of a &#8216;program&#8217; or &#8216;script&#8217;.

Which is what I did. You can find it at https://github.com/tjluoma/maswatch. My script uses Growl, and, more specifically, growlnotify to send you a notification every time the script loops.[2] That notification will show you the total size, the downloaded size, and the difference between the current downloaded size and the previous download size (to give you an idea how fast it is downloading).

To use the script, you&#8217;ll need to: 


Download and install Growl and growlnotify.
Download the script 

curl -L &#8211;remote-name https://github.com/tjluoma/maswatch/raw/master/maswatch.sh 
Make it executable:

chmod 755 maswatch.sh 
Then start your download from the Mac App Store using the App Store app.
Once the download has started, run the script in Terminal:

./maswatch.sh


It should find the .pkg file and then start reporting the download size. 






If you have stray &#8216;pkg&#8217; files in /var/folders/ (inside the &#8220;/com.apple.appstore/&#8221; folder), it might be that a corrupted download is interfering with subsequent attempts. That seems unlikely, but is theoretically possible and it felt like I should at least mention it. &#160;&#8617;



Someone with a basic understanding of Un*x could read the script and change it to use echo instead of growlnotify, but that, as my Comp Sci professor used to say, &#8220;has been left as an exercise for the reader.&#8221; &#160;&#8617;