Ubuntu – Cannot remove file from trash that was put there as root

locationroottrash

I know about the dangers of using root access so please forego the lectures. I try to be careful and will be doubly so from now on.

I was using the file browser with root access in order to change some file permissions. During the process I deleted some files (I should say that I out them in the trash). Little did I know that the files would go to the trash as root and now I can't remove them because I don't have the permission to read them but I don't know how to access them to change the permissions because I don't know how to get into the trash as root. All I get is a message saying that:

This location could not be displayed.

Sorry, could not display all the contents of trash:///: Operation not supported

I have searched around to try to find posts about it but I've only found outdated information about a hidden file in the root directory. That doesn't seem to apply any more so I'm stuck with a file in my trash that I can't remove and can't gain access to.

I'm using Ubuntu 14.04 64bit on an ASUS x401a laptop.

Best Answer

You will need root access to the trash to be able to delete these files - the easiest way to do this in a temporary sense, is to open a terminal window alt+ctrl+t, and enter the command

gksudo nautilus /home/your_username/.local/share/Trash

This will execute the file manager with super-user permissions and you should be able to empty the trash from here. Delete the root-owned file.

When you are done, remember to close the program!

Related Question