1

When using natilus as root, open in terminal used to work as using with any user. However, when I press open in terminal when using nautilus as root now, it does nothing.

How to solve it?

The error:

GLib-GObject-CRITICAL **: g_object_set_data: assertion 'G_IS_OBJECT (object)' failed
Vitor Abella
  • 7,537
  • Do NOT use sudo with graphical aplications, especially Nautilus or any other file manager. It can break the userspace permissions quite easily. If you need to do then use sudo -H nautilus instead. –  Oct 04 '16 at 23:33
  • @CelticWarrior I have to constantly make changes on /opt folder. Can I do it using -H? – Vitor Abella Oct 05 '16 at 05:16
  • Yes, you can and should even if it doesn't mess with permissions on system, root owned, folders. The problem is when you write something (as root) to the regular user(s) folders. –  Oct 05 '16 at 09:11

1 Answers1

2

Putting aside any possible damage you've done via sudo nautilus command you could just install & use the nautilus extension nautilus-admin, requires restarting nautilus after install

sudo apt-get install nautilus-admin

It provides

* Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges. * Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

Does so thru a policykit policy.

doug
  • 17,026
  • It does not really answer my question, but it is a good solution. – Vitor Abella Oct 05 '16 at 16:46
  • As far as an answer - While sudo nautilus > open in terminal should open a root terminal @ dir. clicked on it's such poor behavior that figuring out why it 'broke' for you is pointless. Maybe from repeated indiscriminate use of sudo in instances it shouldn't be used? If I were you I'd check recursively for root owned files in your $HOME folder & address. ls -lA -R |grep root – doug Oct 05 '16 at 22:03
  • I now that I created many root owned files, but I also know how to revert it. – Vitor Abella Oct 05 '16 at 23:01