14

Is there any way to open root file browser in raspbian (like gksudo nautilus in ubuntu)?

opu 웃
  • 429
  • 1
  • 3
  • 10
  • 1
    What are you trying to do with a root file browser? It may be easier and potentially safer from the command line. – Steve Robillard Oct 11 '16 at 11:21
  • You can always install gksudo on Raspbian: sudo apt-get install gksu should work. – Huygens Oct 11 '16 at 11:23
  • I need to modify some system file. @SteveRobillard – opu 웃 Oct 11 '16 at 11:33
  • I tried the command gksu but it is saying 'Xlib: extension "RANDR" missing on display ":1.0".' – opu 웃 Oct 11 '16 at 11:42
  • 2
    try this from the command line sudo nano filenametobemodified obviously using the file you need to modify – Steve Robillard Oct 11 '16 at 11:49
  • I agree with Steve. It is much better to use that kind of command line. Simply opening the file manager as root will let you rename files and such but it will not allow you to click-to-edit since the edit program (nano, leafpad, vi) will not run as su. What would REALLY help with this is a simple "open in terminal" from file-manager - then issue the sudo vi filename just like in Ubuntu. – SDsolar Oct 29 '17 at 01:32

5 Answers5

17

Typing gksudo in Terminal and then hitting enter. A window named Run program will pop up.

Then typing pcmanfm on the Run text field. Pressing ok.

That worked for me.

img 1

opu 웃
  • 429
  • 1
  • 3
  • 10
  • Excellent. Good for file renaming and such. However, when you click to open a file in vi or leafpad it still won't save back to it. – SDsolar Oct 29 '17 at 01:30
16
  1. Open the Terminal
  2. Type sudo pcmanfm

The root file manager opens.

Darth Vader
  • 4,206
  • 24
  • 45
  • 69
Mark
  • 161
  • 1
  • 2
4

You will find that 'mc' ( midnight commander ) is the fastest for browsing and file operations - CTRL+o will give you a root shell prompt to view output of commands. On a Pi, it's lightweight. You don't want to swap to your microSD. Invoke `apt-get -y install mc' . A number of common operations are 'hit-one-key-and-presto!' on the Function keys .

user400344
  • 264
  • 2
  • 4
2

Just start your file manager as root.

Let's say your file manager is pcmanfm, then you should run these commands

pi@mypi:~$ sudo su
[sudo] password for pi: 

root@mypi:/home/pi# pcmanfm 1>/dev/null 2>/dev/null &
vaha
  • 1,240
  • 2
  • 11
  • 20
  • 2
    why not simply sudo pcmanfm? – Dmitry Grigoryev Oct 13 '16 at 10:20
  • In the case of accessing Environment Variables of root, user space should be changed. We can not know which variables are needed by the running process (i.e. pcmanfm). – vaha Oct 13 '16 at 10:24
  • Actually we can know that if we check man pcmanfm. Your approach will replace desktop and menu entries with the ones from root user, if corresponding variables are configured in /root/.bashrc. I don't really see the benefit. – Dmitry Grigoryev Oct 13 '16 at 10:48
  • I don't mean that we can not know variables specifically required by pcmanfm. I mean that to forget about this kind of concerns for ANY process we want to run, we should run it after sudo su in a generic/nonspecific manner. – vaha Oct 13 '16 at 10:58
2

Running sudo file-manager should be enough to start whatever file manager you have configured. Depending on your setup, you may need to run xhost + as the user who owns the desktop, to allow root processes to connect to it.

Finally, if your X configuration is really bizarre, you might need to tell the file manager which display it should use, i.e. sudo DISPLAY=:0 file-manager. Note that this should not be necessary in a normal setup.

Dmitry Grigoryev
  • 27,928
  • 6
  • 53
  • 144