6

I'm trying to use gvfs-trash, and I get an error.

$ trash thefile
Error trashing file: Unable to find or create trash directory

How can I fix this?

$ ls -ld ~/.local/share/Trash/
drwx------ 4 username username 4096 Jul 24 22:23 /home/username/.local/share/Trash/

ls -ld ~/.local/share/
drwx------ 3 username username 4096 Jul 24 22:23 /home/username/.local/share/
  • Where is thefile located? – muru Sep 28 '15 at 7:58
  • Please edit your question and add the output of ls -ld ~/.local/share/Trash/ and ls -ld ~/.local/share/. – Byte Commander Sep 28 '15 at 8:11
  • @ByteCommander Edited. – Hatshepsut Sep 28 '15 at 8:20
  • 2
    As muru already asked, where is the file located you want to trash? Is it on your root partition or another partition on your internal disk or on any external medium like USB sticks? – Byte Commander Sep 28 '15 at 8:24
  • 1
    @muru it is on the root partition. It's in a subsub directory of /var/ where I am a group member, not the directory owner. I am able to gvfs-trash files in ~. – Hatshepsut Sep 28 '15 at 8:29
6

When you trash a file that's not on the same partition on your home directory, it's moved to the .Trash-1000 directory on the root of whatever partition you are. Make sure that directory .Trash-1000 is writable for the user under which you want to trash the file.

I got the same failure too, my root partition was different than my home directory - which is a encrypted partition. The directory /.Trash-1000 was not writable by the current user I was logged in. Solved by running

sudo chown MYUSERNAME /.Trash-1000

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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