Comment 9 for bug 1310680

Revision history for this message
Piet Starreveld (pstarrev) wrote : Re: Your Firefox profile cannot be loaded. It may be missing or inaccessible.

@tomi0: Synaptic uses xdg-open for visiting URL's and when you set your personal default browser to chrome, root's default still remains firefox. Additionally, the xdg-open man-page says 'xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root', but anyway, here goes a workaround :-)

Steps 1 thru 4 below are one-time only. Note that the workaround ONLY works when using sudo to run synaptic from the command line (step 5). It's not required start synaptic in the background - that's just my personal preference.

# 1. confirm root's web-browser is reported as 'firefox.desktop'
sudo xdg-settings get default-web-browser

# 2. create dirs missing for chrome to be able to become root's default web-browser
sudo mkdir -p /root/.config /root/.pki/nssdb

# 3. change root's default web-browser to chrome
sudo xdg-settings set default-web-browser google-chrome.desktop

# 4. ensure newly created dirs have proper access
sudo chmod 700 /root/.config /root/.local /root/.pki

# 5. run synaptic in background from command line using sudo
sudo synaptic &>/dev/null &

Here's the relevant /var/log/syslog entries before (and when using Synaptic's 'authentication' dialogue):

synaptic.desktop[6148]: Error: Access was denied while trying to open files in your profile directory.
synaptic.desktop[6148]: (firefox:7212): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
synaptic.desktop[6148]: Failed to connect to socket /tmp/dbus-19wsCpfYwj: Connection refused
synaptic.desktop[6148]: mkdir: cannot create directory ‘/root’: Permission denied
synaptic.desktop[6148]: touch: cannot touch '/root/.local/share/applications/mimeapps.list': Permission denied
synaptic.desktop[6148]: [0513/081219:ERROR:nss_util.cc(98)] Failed to create /root/.pki/nssdb directory.
kernel: [ 3701.124769] traps: chrome[7261] general protection ip:7f30c819a186 sp:7ffed3d45840 error:0 in libc-2.23.so[7f30c8163000+1c0000]
synaptic.desktop[6148]: [0513/081219:ERROR:nss_util.cc(98)] Failed to create /root/.pki/nssdb directory.
synaptic.desktop[6148]: Error: Access was denied while trying to open files in your profile directory.
synaptic.desktop[6148]: (firefox:7324): GConf-WARNING **: Client failed to connect to the D-BUS daemon:

And here's the relevant entry remaining after (i.e. step 1 thru 4 completed and starting synaptic using sudo):
google-chrome.desktop[11464]: context mismatch in svga_sampler_view_destroy

Btw: I am using Ubuntu Gnome 16.04 LTS