Saturday 29 January 2011

Googley Earth - tip "could not write to the current cache"

Google Earth runs great on ubuntu as do many applications, in fact many are developed on open source or linux environments and ported to Windows rather than the other way around.

Anyway, I noticed when I put Ver 5 and Ver 6 in that I had an obvious permissions error when starting, it would say "Google Earth could not write to the current cache or myplaces file location. The values will be set as follows:

My Places Path: "/home/username/.googleearth"
Cache Path: "/home/username/.googleearth/Cache"

Clearly the program has a default path which is not in the permissions route, normally you would expect to see this if for example you installed a program under your own user ID and not as root, if the default directory for storing files was under the ownership of root then clearly you cannot write here.

A simple fix though, the configuration file is held in this location:
/home/your_username/.config/Google
This is a hidden directory, the directory is case sensitive so Google is capital G.

The default for the two store locations are /root so this is obviously the issue as we're running the program as ourselves.

A quick check also shows we have the Google Earth cache in a subdirectory of our home in this case my home directory is "kevin" so the directory is:

/home/kevin/.googleearth
In there is the KML files and the Cache subdirectory.

To get everything going nicely just edit the config file (as sudo)

To save typing let's assume I've changed into the /home/kevin/.config/Google directory ?

sudo gedit GoogleEarthPlus.conf

right near the start edit the two lines below to show the path to your cache and main folder i.e the ones you have permissions for as in my example.

[Original]
KMLPath=/root/.googleearth
CachePath=/root/.googleearth/Cache

[Edited]
KMLPath=/home/kevin/.googleearth
CachePath=/home/kevin/.googleearth/Cache

Save the file and start Google Earth and the error is gone

It's clear to see here the original location is /root, if your running the program as yourself then you have no user rights in the /root folder unless the folder is chmod to 777 (or whatever permissions you would need) or your user is in the permissions group, this is not a clean way of doing things and you may as well mess about in the low security environment of Windows if your going down that route.
All that's been done here is to point Google Earth to your folder settings, in this case the cache files in /home/kevin i.e my files, I have permissions on my own files so when I launch the program by simply double clicking the desktop icon I am launching it with permissions "kevin", this all matches up and it means no one has messed about with security to open any holes etc.

In fairness I don't think I would expect the installer to make this change, in fact I would prefer to make it myself and define the KML and Cache paths for these exact reasons and that way I ensure I know where they are and the permissions they will need etc.

No comments:

Post a Comment