If you have been using Dropbox in your Ubuntu (or any other distro) machine, after one of the upgrades, you might have noticed that it is starting to prompt you to enter your password and run as a superuser. This is not a normal incident as Dropbox is installed in your local home folder and shouldn’t require elevated permission to run. If you are running into this issue, here’s the fix.
Causes for this issue
If you didn’t realize it, the executable file for Dropbox lies in the “/usr/bin” folder and it is pointing to the “/var/lib/dropbox” folder for its config files. Since the “/var/lib/dropbox’ folder is in the root directory, it will need superuser permission for Dropbox to be able to access it.
However, that is not the main cause of the problem. The main issue is that your config file should lie in your home folder (~/.dropbox-dist/), and it shouldn’t point to the “/var/lib/dropbox” folder.
Here’s the fix.
1. Open a terminal and type:
This will show you the actual filepath of the dropbox executable file. In most cases, it will be “/usr/bin/dropbox”
2. Open it with the nano text editor:
sudo nano /usr/bin/dropbox
3. Scroll down in the file until you find the lines:
PARENT_DIR = os.path.expanduser("/var/lib/dropbox") DROPBOXD_PATH = "%s/.dropbox-dist/dropboxd" % PARENT_DIR
If you understand the code, it simply means that the “DROPBOXD_PATH” is pointing to the “PARENT_DIR”, which is “/var/lib/dropbox”.
All we need to do is to change the filepath “/var/lib/dropbox” to “~”, so it becomes:
PARENT_DIR = os.path.expanduser("~")
This will direct Dropbox to access your Home folder for the config files.
4. Save (Ctrl + o) and exit (Ctrl + x) the nano text editor. Restart Dropbox.
dropbox start -i
-i flag prompts Dropbox to reinstall the module if it doesn’t exist in the Home folder.
That’s it. It won’t prompt you to enter password and run as superuser again (unless the next update breaks it again).
Our latest tutorials delivered straight to your inbox