28

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

Samuel Ochoa
  • 403
  • 1
  • 4
  • 9
  • 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. – Samuel Ochoa May 01 '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](https://askubuntu.com/questions/614752/cant-move-files-to-trash-without-any-permission-issues?rq=1) for a different solution - a bug causing this in special cases. – Volker Siegel Apr 25 '17 at 08:32
  • This message also occurs if the file is too large for the trash – ravery Jan 01 '18 at 05:58

6 Answers6

54

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.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
kr4utz
  • 681
  • 6
  • 6
20

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.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
Stephen Temple
  • 203
  • 1
  • 3
6

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

Byte Commander
  • 105,631
  • 46
  • 284
  • 425
dr mat
  • 371
  • 3
  • 10
  • 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: (http://askubuntu.com/questions/113733/how-do-i-correctly-mount-a-ntfs-partition-in-etc-fstab) – 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 06: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

Jan Wytze
  • 207
  • 2
  • 10
-3

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 700 Trash/

Now your deleted files will move to Trash.

Rahul Satal
  • 357
  • 1
  • 4
  • 13
  • 3
    **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 01 '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
mook765
  • 14,911
  • 5
  • 35
  • 67
  • 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. In this case a *sticky* folder, i. e. `1777` permissions, would be an acceptable solution for home use. -1 – David Foerster Oct 04 '16 at 17:13