Unable to find or create trash directory?

37,969

Solution 1

If you have touched your /etc/fstab then you have to fix it. Your lines there must be something like /dev/sdc1 /media/Data ntfs-3g defaults,uid=1000,locale=en_US.utf8 0 2.

Note about uid=1000

Solution 2

No need to have it somewhere else to copy it:

First, confirm that your normal user is ID "1000":

$ id

Then

$ sudo mkdir -p /.Trash-1000/{expunged,files,info}
$ sudo chown -R $USER /.Trash-1000

Solution 3

For me this happened after I added the LXQT window manager; I'm unaware if that is related, but I am using a fresh install and that is all I have done so far, so that is why I mentioned it. To fix it, I simply had to change the permissions for the Trash directory:

sudo chown -R $USER ~/.local/share/Trash

Solution 4

This happens if you delete the trash directory. If you are the only user in the system, it is a hidden directory named ".Trash-1000" in each partition (HDD or removable device). This must contain three directories: 1. "expunged" 2. "files" 3. "info"

I would suggest copying the directory from another partition and deleting the files in it.

I had the same problem and it was solved this way. Your case may be different.

Solution 5

I have a similar problem after installing LXQT/lubuntu and switching back to Ubuntu. A simple solution is to go to ~/.local/share folder and delete the "Trash" folder.

sudo rm -R ~/.local/share/Trash

Then try to delete a file, it will create the default Trash folder with all the required permissions.

Share:
37,969

Related videos on Youtube

حسن الشناوي
Author by

حسن الشناوي

Updated on September 18, 2022

Comments

  • حسن الشناوي
    حسن الشناوي almost 2 years

    I am a user of Xubuntu and I have a problem with it. When I delete any files outside home they can't be deleted and instead of that, a message appears to me and says "Unable to find or create trash directory". I hope I find a solution for this problem, as I can't get rid of useless files. Thanks.

  • حسن الشناوي
    حسن الشناوي over 11 years
    I have no folder in etc called fstab but I have fstab.d
  • Mostafa Shahverdy
    Mostafa Shahverdy over 11 years
    fstab is not a folder, it is a file
  • MakisH
    MakisH over 11 years
    I really don't know and I have the same question.
  • ubuplex
    ubuplex over 10 years
    The trick with uid=1000 (my user id on a single user system) works. But does that not mean that if there is another user, she/he will create all files with myself as the owner? There must be some other solution...
  • barrypicker
    barrypicker almost 10 years
    This did not work for me. Also, the second command entered a prompt asking for additional information.
  • Greg Bell
    Greg Bell almost 10 years
    I've edited my answer... try now.
  • Adrian
    Adrian over 7 years
    Xubuntu appears to delete user files to /home/user/.local/share/Trash (containing the three aforementioned sub-folders) these days. Might want to add that information.
  • Abhishek Divekar
    Abhishek Divekar over 7 years
    I'm having trouble understanding this answer...what does "Your lines there must be something like ..." mean? Should we add the lines? Are the lines supposed to exist and we should edit them?
  • Leonardo Petrucci
    Leonardo Petrucci over 4 years
    This worked for me, no idea why it happened in the first place. Don't forget to restart after the command.
  • Giri Annamalai M
    Giri Annamalai M about 4 years
    Working for me. Thanks.
  • Levente
    Levente about 3 years
    @AbhishekDivekar /etc/fstab's contents will always reflect (describe) how your system is composed. The composition is made up from partitions found on the primary-, and possibly other, connected disks. The system will attempt to mount each partition that has a line about it in /etc/fstab upon system startup. If a partition has no entry here, then you will need to mount that manually, when you need it. However, when there is a line there that does not correspond to any existing real partition, you have problems and errors. So don't just add there just anything, out of experiment.