24

This question already has an answer here:

When I want to move a file to the Trash, Nautilus give me an message saying this:

You can't move example.file to the trash can. Do you want to remove it immediately?

I can give you this photo but it's in Spanish

enter image description here

marked as duplicate by Eric Carvalho, Charles Green, Zanna, waltinator, vidarlo Jan 1 '18 at 19:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • It's this file in a remote drive? Those types of drives does not support Trash. Some removable storage also does not support Trash. – Lie Ryan Apr 30 '13 at 14:29
  • @lie-ryan The files I tried to remove are in my home folder. – S8A May 1 '13 at 20:24
  • I've just ran into this because I mounted an extra drive on /home/.../.local (for Steam games). Apparently Nautilus expects to be able to rename the file into the Trash folder. – Thorbjørn Ravn Andersen Dec 11 '14 at 10:37
  • See also can't move files to trash without any permission issues for a different solution - a bug causing this in special cases. – Volker Siegel Apr 25 '17 at 8:32
  • This message also occurs if the file is too large for the trash – ravery Jan 1 '18 at 5:58
50

I had the same problem and found out that the trash had the wrong owner. So I deleted the trash folder and made a new one.

Steps:

  1. cd ~/.local/share
  2. ls -ld Trash
  3. Now you have to look if it has the right owner.
  4. If the owner is root - delete the folder with: sudo rm -r Trash
  5. mkdir -m 700 Trash

Hope I could help and that it solved your problem, because it did for me.

  • 2
    Instead of deleting sudo chown -R $USER: Trash as mentioned in the other answer should work as well to get the owner right... – Byte Commander May 6 '16 at 13:30
  • 1
    I do not understand why this would happen on a fresh install of gnome 16.04.1 . Something is wrong.. But thanks .. this worked. Plus one given – Bhikkhu Subhuti Aug 18 '16 at 0:39
19

As mentioned by kr4utz your problem is that Trash is owned by root.

A better way of changing the ownership without deleting the Trash folder would be to use the chown command from a terminal (Ctrl+Alt+T):

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

That will change the owner from root to yourself without deleting your Trash folder.

  • 2
    Would it be a good idea to do so recursively (with the -R option)? – Léo Lam Jun 27 '14 at 19:33
  • I had to "chown -R..." in order for this to work (to get at the inner files and info directories) – Todd Oct 10 '14 at 19:31
4

That's what worked for me, if the files that refuse to delete are on a partition which is not formatted as ext*:

Open /etc/fstab in any editor as root (e.g. using sudo nano /etc/fstab).

There add in the line of the partition you have problems the option uid=1000 (if your user ID is 1000, else change it)

Example:

/dev/sdb2   /media/scambio      vfat    rw,utf8,umask=0,uid=1000    0     0

and reboot

  • How do you reach that conclusion? – guntbert Feb 20 '16 at 22:09
  • That's a suggestion I found on the Italian Ubuntu forum. I looked into the problem deeper some time ago for a different computer and that time it worked, so I re-searched the site and reapplied it last week on this computer with an analogous problem. It seems to be a problem of the read-write permission given via fstab if I remember well, You might find something about it in the fstab-wiki. – dr mat Feb 22 '16 at 15:10
  • It seems to be a problem of the ownership of the mount and of the read-write permission (rwx) given via fstab . The, in my case, missing uid=1000 seemed to garble the ownership and prevented the normal file deleting. I'm no expert, but see: (askubuntu.com/questions/113733/…) – dr mat Feb 22 '16 at 15:27
  • Don't forget to create a folder named .Trash-1000 in the root of that drive, if it doesn't exist already – kurdtpage Jan 30 '18 at 6:06
0

I found other solution that works for me. I had the folder Trash where the owner was root.

I delete the folder Trash like root user, you can do it directly from terminal with the correct command or like I did, I enter in the terminal the command:sudo nautilus, this open the nautilus like root user, I look for the folder Trash (.local/share/Trash) and I delete it (like root user) and after this I close the nautilus. I opened again the nautilus but like username (I mean normally), I delete some file and this automatically creates a folder Trash where the ownership now was my username.

Sorry for my english

-2

I have tried all above solutions but they didn't worked for me. Then I just gave all the permissions to Trash folder and it worked. Follow the below steps-

Step 1: Open Terminal.

Step 2: Run the command- cd /home/username/.local/share

Note that you have to replace "username" with your username eg. for me it is- cd /home/willson/.local/share

Step 3: Give all the permissions to Trash folder using Command-

sudo chmod -R 777 Trash/

Now your deleted files will move to Trash.

  • 1
    Please don't recommend 0777 a.k.a. “please-hack-my-system-and-destroy-my-data” permissions for no apparent reason! There's almost never a reason to to that because it can be avoided with more sensible modifications like changing (group) ownership. -1 – David Foerster Nov 1 '16 at 11:34
-3

For me, it was that partition was mounted in a folder owned by root and others didn't have write permissions

drwxr-xr-x 22 root    root    4096 Sep 17 01:31 data

So the trash folder could not be created in the top folder

I just changed the permissions of the folder were the partition is mounted.... and voila, it worked!!!!

sudo chmod 777 data
  • Please don't recommend 0777 a.k.a. “please-hack-my-system-and-destroy-my-data” permissions for no apparent reason! There's almost never a reason to to that because it can be avoided with more sensible modifications like changing (group) ownership. In this case a sticky folder, i. e. 1777 permissions, would be an acceptable solution for home use. -1 – David Foerster Oct 4 '16 at 17:13

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