0

I'm on Ubuntu 14.04.

Here is what happens when I run "nautilus /". The program runs, and the terminal goes to the next command line. Perfect.(http://postimg.org/image/9cpyfjqvp/)

But here is what happens when I try to run "sudo nautilus /". The program runs, but an error message displays, and the terminal does not go to the next command line. (http://postimg.org/image/3ptli2od1/)

Here is what happens when I try to go to the next command line without closing the program, by using Control+Z. The program freezes solid, and needs to be force-quit. Well that's even worse.(http://postimg.org/image/m6o08w4b9/)

Here is what happens when I then try "sudo nautilus /&". The program literally doesn't even run, then displays an error message, and fails to leave me on a command line.(http://postimg.org/image/pg2ffcset/)

I try Control+C, then "exit", only to find that there are apparently stopped jobs. That's… odd, but I figure it might be worth taking a screenshot of, in case it means something.(http://postimg.org/image/3uxcrqvo5/)

After restarting my computer, "sudo nautilus /&" literally just does nothing. It doesn't even ask me for my password, or give me an error message, or anything.(http://postimg.org/image/cscab8dbl/)

But "sudo nautilus /" apparently still works, with the same problems as before.(http://postimg.org/image/7icu68fcx/)

After exiting the program using the upper left X-button, a bunch of error messages are pumped into the terminal window, but I am fortunately dropped off on a new command line.(http://postimg.org/image/6vdxgpigx/)

Oddly, this time, I can still use "sudo nautilus /".(http://postimg.org/image/re8tlrwe9/)

Exiting the program using Control+C produces zero error messages, however using "exit" afterward reveals another stopped process.(http://postimg.org/image/pyfrxwox3/)

How do I run Nautilus as administrator from the terminal, and go to the next command line?!

1
  • 1
    I wouldn't run Nautilus with sudo to begin with.
    – xangua
    Jul 24, 2015 at 15:53

3 Answers 3

5

gksudo seems appropriate:

gksudo nautilus / &

From the gksudo man page:

   gksu  is a frontend to su and gksudo is a frontend to sudo.  Their pri‐
   mary purpose is to run graphical commands that need  root  without  the
   need to run an X terminal emulator and using su directly.

Note: if gksudo is not available for your release of Ubuntu you can get it with:

sudo apt-get install gksu
0
1

Using the pure CLI way ;)

sudo -i nautilus / & disown

disown – Remove jobs from the table of active jobs

sudo -i – Run the shell specified by the target user's password database entry as a login shell.

-2

Try xdg-su -c "nautilus /" &

I use xdg-su whenever I run into problems opening gui applications with sudo

From xdg-su --help:

xdg-su ? run a GUI program as root after prompting for the root password

Synopsis

xdg-su [-u user] -c command

Not sure if xdg-su comes out of the box with ubuntu. If not, try what Sylvain Pineau suggested, gksudo

4
  • In which package is xdg-su? apt-file search xdg-su gives no results.
    – A.B.
    Jul 24, 2015 at 17:21
  • I believe the package is called xdg-utils, but I'm not sure
    – Davide
    Jul 24, 2015 at 17:25
  • No, there is no file with this name in xdg-utils
    – A.B.
    Jul 24, 2015 at 17:30
  • After a bit of searching, I found a bug report from 2011 asking for xdg-su to be included in xdg-utils for ubuntu. It seems very odd, since other major distros come with xdg-su out of the box
    – Davide
    Jul 27, 2015 at 8:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .