That pesky Download Pending state on Google Play Store

This ever happened to you where an app is being updated by Google Play Store but it just sits there and waits for that supposed update indefinitely? Perhaps you’ve stared at that screen for too long waiting for it to complete the download and start the installation process for several minutes, maybe hours? It certainly is not your Internet connection that is the issue, you’re sure on this and have checked it several times. What’s worse, this holds up other apps from getting there updates. The update queue can’t go on.

Well, this has happened to me already.

On some similar occasions a simple phone restart fixed the issue. On another, stopping the update on the app, allowed for other apps to get their updates. While there were also times that it was just my network connection that kept it from getting updated properly – such as when I forced it to update over mobile data, then I transfer to a location where carrier service is not so strong (in high rise buildings for example). I simply switch to WiFi when available and the update process continued smoothly afterwards.

Recently though, no amount of phone restarts, or switching networks fixed this issue when my phone ran into it again.

The one way that I corrected it is after I cleared the cache & data of the Google Play Store app. This was after I’ve restarted my phone for the nth time, and the app was still stuck at downloading the updates. Yes, I’ve also tried to kill or force stop Google Play Store. To no avail.

Depending on your phone, go to its Settings. Find the Apps or App Settings further down. Select Google Play Store. The options should be there, most likely under Storage.

Try this out if you’ve done all the other things but still have that app stuck on update. Don’t worry about losing anything. The Google Play Store app will recover, and almost everything you have specifically for this Android phone will have been saved on the cloud.

Compress all files in a directory separately via command line

How to do this fast and easily? I don’t care about what type of compression was used.

When I say compress I am referring to using a tool such as ZIP to make a file smaller. Separately – that is each file will have its own zipped file, instead of all being bundled into one big one.

ANSWER

On a Linux shell, such as Bash, I can do this command to zip up all the files in a directory individually.

find . -type f -exec zip -D '{}.zip' '{}' \;

The find command allows for finding many things. Here we specify where to look for it through that dot right after the command. Dot means the current directory location. Then the -type f tells it to find only those considered as regular files. Followed by the -exec zip so that when it finds those files it will do a zip on each one. The curly brackets is so that filenames are retained, then appended with a .zip file extension at the end.

Find is recursive. So it will also go down to subdirectories and zip any files in there, and so on. It can be prevented. One way is to use -maxdepth option. If I want it to not recurse deeper I tell it to have a max depth of 1.

find . -maxdepth 1 -type f -exec zip -D '{}.zip' '{}' \;

There are other ways – such as using a for loop on bash – but I’ve always been more comfortable with doing this through the find command.

Then there is also the gzip compression tool. This is another one similar to zip. Gzip command is much simpler and shorter.

gzip *

The * is a wildcard that matches any of the files that are in that current directory. It will ignore directories, so any files in subdirectories will not get compressed. Note that this short command deletes the original file once it’s been compressed. If I want to keep these files, I would put the -k option (long form is --keep).

gzip -k *

These commands will work on perhaps majority of Linux distros, assuming the zip and gzip applications are installed. It will also work on Bash-like shells for Windows. Better yet, Windows 10 has the Windows Subsystem for Linux feature.