Running Raspbian on RPi B+, I can sudo in command mode and do all operations like deleting a directory, etc. But when in GUI mode I get permession denied, although I am using the same user in both cases.

What's the solution?

2 Answers 2


The safe way to do this on raspbian is via gksudo in the gksu package.

Running GUI apps via sudo is possible but can create problems, e.g. see here; a graphical desktop is a complex thing and just plain sudo is a dumb mechanism -- if the app you want to run writes to some kind of status or lock file as root, it won't recognize the consequences for you, the normal user. And likely you won't either until you are mysteriously unable to use the desktop at all.

The rest of that Q&A may be of interest to you as well.

  • Actually I just want to copy / paste / cut files, and not launch any specific application.
    – student1
    Jan 4, 2015 at 16:31
  • You can try starting the LXDE file browser, pcmanfm, with (gk)sudo.
    – goldilocks
    Jan 4, 2015 at 16:53

I'm not sure there is an appropriate solution (there are solutions which I'll leave to others as I don't think them sensible).

You should only run up against this problem when you want to do system administration. You shouldn't need to use sudo for general day to day work.

The system is blurred on the Pi as the normal user will almost invariably be the same person as the system administrator.

I'd spend some time examining why you need to use sudo. It shouldn't be needed for anything you do in your /home/user directory.

For the rest I'd just launch a command shell from the GUI and enter the needed sudo commands there.

  • I simply have git cloned a repo and would like to copy & paste some files but Raspbian wants me to have permission.
    – student1
    Jan 4, 2015 at 16:33
  • 1
    Did you use sudo to do the git clone rather than just a standard git clone? Check the ownership of the files by navigating to the top clone directory and trying ls -l. If they are owned by root change them to be owned by you, e.g. in the clone directory "sudo chown pi.pi -R .", without the quotes, to recursively change in that directory and beneath.
    – joan
    Jan 4, 2015 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.