Can't empty trash completely

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Can't empty trash completely

Postby gumby » Sun Sep 13, 2009 5:57 am

I had dozens of files in the trash can and when I did an empty trash command, most of them disappeared except for 5 files, most of them big, i.e., over 1 GB.

Now when I try to empty trash again nothing happens. The files are still there.

I right clicked on the files and selected "Delete Permanently" but got error message: "Error while deleting. Failed to delete the item from the trash."

These files are not connected to any running program that I am aware of. Can anyone suggest a way to delete them? Thanks.

User avatar
DrHu
Level 17
Level 17
Posts: 7560
Joined: Wed Jun 17, 2009 8:20 pm

Re: Can't empty trash completely

Postby DrHu » Sun Sep 13, 2009 8:24 am

gumby wrote:I right clicked on the files and selected "Delete Permanently" but got error message: "Error while deleting. Failed to delete the item from the trash."

Nautilus>Edit>Preferences>Behavior TAB Trash
    [ ] Ask before emptying Trash or deleting files
    --if you leave this turned on you always get asked if you are sure you want to delete those file(s)
    [x]Include a delete command that bypasses Trash
The delete selection is supposed to bypass Trash, and simply delete the file, the second msg you see is what you say, delete permanently
--although that is misleading as it is not a wipe or shred of that file (a proper permanent deletion) , it simply dissociates the file (link) from the system, so that the system is not aware that it exists..
--in that way it is similar to windows.

https://bugzilla.redhat.com/show_bug.cgi?id=456035
http://ubuntuforums.org/showthread.php?t=785512
https://bugs.launchpad.net/ubuntu/+sour ... bug/366379
https://bugs.launchpad.net/ubuntu/+sour ... o_package=
    Trash does not empty search..
Might be a nautilus bug or you might have some files moved as root into that trash directory or you are moving to trash across partitions; eg. an external drive..

In terminal, check Trash contents
    ls -l /home/userID/.local/share/Trash
--where userID is your logged in user

Example removable for one of the directories in Trash (files, expunged, info)
    sudo rm -r /home/userID/.local/share/Trash/files
http://www.ubuntugeek.com/empty-ubuntu- ... -line.html
--a shorter command for a similar result

Permanently delete files (shred and other methods)
http://ubuntuforums.org/showthread.php?t=868953
--use this location /home/userID/.local/share/Trash

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Tue Sep 15, 2009 8:58 am

Dr.Hu,

i Just tried checking "Include a delete command that bypasses trash." Trash still won't empty. When I open trash I see the 5 big files (several GB each) When I try to "delete permanently" one of them, I get the error message:

Error while deleting:
There was an error getting information about [name of file]
Show more details:
No such file or directory

When I try deleting permanently the other 4, I get this message:

Error while deleting:
There was an error deleting [name of file]
Show more details:
Failed to delete the item from the trash.

I still haven't tried your other suggestions. Will do so soon. Thanks.

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Tue Sep 15, 2009 9:02 am

by the way, I wondered if maybe a different file manager could delete the files, so I downloaded a few like Gnome Commander and Beesoft Commander. But I can't get either of them to even display the trash can. They don't seem to operate like the Windows file managers that show everything on the desktop, i.e., xplorer2

User avatar
DrHu
Level 17
Level 17
Posts: 7560
Joined: Wed Jun 17, 2009 8:20 pm

Re: Can't empty trash completely

Postby DrHu » Tue Sep 15, 2009 10:50 am

gumby wrote:by the way, I wondered if maybe a different file manager could delete the files, so I downloaded a few like Gnome Commander and Beesoft Commander. But I can't get either of them to even display the trash can.

...But I can't get either of them to even display the trash can.
    My first reply..
    Example removable for one of the directories in Trash (files, expunged, info)
    sudo rm -r /home/userID/.local/share/Trash/files

The Trash folder is under /home/userID/.local/share/
--and should be able to be seen under Gnome-commander if you open .local
    In Gnome-commander check the Settings>Options>Filters, see if you are hiding (Filetypes to Hide, Also Hide) hidden files, in which case the .local file (directory) won't show in the display..

You will probably have to end up doing it with root privilege, open a terminal in Gnome-commander when you are at the correct directory (folder)
    /home/userID/.local/share/Trash
--and delete,
sudo rm -r /home/userID/.local/share/Trash/
sudo rm -r ~/.local/share/Trash
--shortcut for /home for the logged in user ( ~/ )

ls /home/userID/.local/share/Trash/files
ls: cannot access /home/userID/.local/share/Trash/files: No such file or directory

If you get this msg when you check the subdir (subdirectory) of Trash (files, info, expunged),
--it means the Trash (files) is emptied

User avatar
hernando
Level 2
Level 2
Posts: 58
Joined: Fri Jul 17, 2009 12:47 pm

Re: Can't empty trash completely

Postby hernando » Tue Sep 15, 2009 2:11 pm

I had that same problem. The problem was the permission, or user privileges.
I finally manage to totally delete the files opening the .Trash folder as root (right click --> open as root ... I love this option). There you have a few folders "Files", "expunged" and something else... I just Shift+Del to permanently delete the files, and voilà !

Or you could log out, and log in as root ...

Hope this can help.

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Mon Sep 21, 2009 3:15 am

DrHu wrote:
gumby wrote:by the way, I wondered if maybe a different file manager could delete the files, so I downloaded a few like Gnome Commander and Beesoft Commander. But I can't get either of them to even display the trash can.

...But I can't get either of them to even display the trash can.
    My first reply..
    Example removable for one of the directories in Trash (files, expunged, info)
    sudo rm -r /home/userID/.local/share/Trash/files

The Trash folder is under /home/userID/.local/share/
--and should be able to be seen under Gnome-commander if you open .local
    In Gnome-commander check the Settings>Options>Filters, see if you are hiding (Filetypes to Hide, Also Hide) hidden files, in which case the .local file (directory) won't show in the display..


Thanks DrHu, I now can see the trash folder in Gnome Commander.

DrHu wrote:You will probably have to end up doing it with root privilege, open a terminal in Gnome-commander when you are at the correct directory (folder)
    /home/userID/.local/share/Trash
--and delete,
sudo rm -r /home/userID/.local/share/Trash/
sudo rm -r ~/.local/share/Trash
--shortcut for /home for the logged in user ( ~/ )


Gnome Commander did not show any files in Trash or in Expunged.

THen I did as you instruct:

gumby@Saturn ~/.local/share/Trash $ sudo rm -r /home/gumby/.local/share/Trash/
[sudo] password for gumby:
gumby@Saturn ~/.local/share/Trash $ sudo rm -r ~/.local/share/Trash
sudo: cannot get working directory
rm: cannot remove `/home/gumby/.local/share/Trash': No such file or directory
gumby@Saturn ~/.local/share/Trash $

and now my Trash folder has disappeared in Gnome Commander although it is still visible in Nautilus. Nautilus trash still shows the undeleted files I am trying to get rid of.
DrHu wrote:ls /home/userID/.local/share/Trash/files
ls: cannot access /home/userID/.local/share/Trash/files: No such file or directory

If you get this msg when you check the subdir (subdirectory) of Trash (files, info, expunged),
--it means the Trash (files) is emptied


Okay, maybe the files are not there, but they are still showing in my trash on Nautilus.

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Mon Sep 21, 2009 3:17 am

hernando wrote:I had that same problem. The problem was the permission, or user privileges.
I finally manage to totally delete the files opening the .Trash folder as root (right click --> open as root ... I love this option). There you have a few folders "Files", "expunged" and something else... I just Shift+Del to permanently delete the files, and voilà !

Or you could log out, and log in as root ...

Hope this can help.


Thanks for the suggestion, Hernando, but there is no "open as root" option in my right click menu. I remember a few months ago I installed something to try to get this option, but it didn't work.

User avatar
pluraldave
Level 5
Level 5
Posts: 708
Joined: Mon Sep 01, 2008 8:05 am

Re: Can't empty trash completely

Postby pluraldave » Mon Sep 21, 2009 10:10 am

Try just right clicking in your home folder. If you do it in the Trash you won't get the option.

If that fails open a terminal and use

Code: Select all

gksu nautilus &

igorzwx
Level 5
Level 5
Posts: 597
Joined: Sat Sep 05, 2009 3:13 pm

Re: Can't empty trash completely

Postby igorzwx » Mon Sep 21, 2009 11:04 am

I had sometimes similar problems in Ubuntu 6.10

Case 1: Symbolic links
This is easy to solve:
1. Create an empty folder.
2. Move it to Trash in a usual way (Right Click -> Trash)
3. Move links to that folder
4. Delete that folder in a usual way

Case 2: Files owned by root

gksu nautilus

This kind of nautilus is red like tomato in Mint.
You can change permissions of those files (Right Click -> Properties -> Permissions), and then remove them in a usual way.

If somebody likes Midnight Commander, he can use it too for many purposes

sudo apt-get install mc

sudo mc

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Tue Sep 22, 2009 2:10 pm

pluraldave wrote:Try just right clicking in your home folder. If you do it in the Trash you won't get the option.

If that fails open a terminal and use

Code: Select all

gksu nautilus &


Thanks Dave. I did as you said and did get the option to open as root. I also tried gksu nautilus &. Unfortunately it did not solve my problem. When I try to open trash as root i get "The folder contents could not be displayed. Sorry, could not display all the contents of 'trash.' Operation not supported."

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Tue Sep 22, 2009 2:19 pm

igorzwx wrote:I had sometimes similar problems in Ubuntu 6.10

Case 1: Symbolic links
This is easy to solve:
1. Create an empty folder.
2. Move it to Trash in a usual way (Right Click -> Trash)
3. Move links to that folder
4. Delete that folder in a usual way

Case 2: Files owned by root

gksu nautilus

This kind of nautilus is red like tomato in Mint.
You can change permissions of those files (Right Click -> Properties -> Permissions), and then remove them in a usual way.

If somebody likes Midnight Commander, he can use it too for many purposes

sudo apt-get install mc

sudo mc


Hi Igorzwx.

I tried your empty folder suggestion and it didn't work. When I try to move the problem files into the folder I get the familiar "are you sure you want to permanently delete the file from the trash?" Yes. "Error while deleting." The odd thing is I'm not deleting the file, I'm trying to move it into an empty folder in the trash.

Just tried to change permissions but could not do it. It seems that the "Owner", Gumby, has read and write permission, but the "Group", Gumby, and "Others" have only read permission. Whether that matters or not I have no idea.

igorzwx
Level 5
Level 5
Posts: 597
Joined: Sat Sep 05, 2009 3:13 pm

Re: Can't empty trash completely

Postby igorzwx » Tue Sep 22, 2009 3:20 pm

"Whether that matters or not I have no idea."

it does not matter. You permissions are most important

It might be a bug in Ubuntu/Mint

It is an innovation

Trash is now "trash:///"

Type on Terninal

nautilus trash:///

nautilus ~/

In Ubutu 6.10, Trash was "~/.Trash"

EDIT: Trash is not Trash anymore. It now a kind of "pulseaudio" :roll:
Last edited by igorzwx on Tue Sep 22, 2009 4:15 pm, edited 1 time in total.

User avatar
DrHu
Level 17
Level 17
Posts: 7560
Joined: Wed Jun 17, 2009 8:20 pm

Re: Can't empty trash completely

Postby DrHu » Tue Sep 22, 2009 3:50 pm

gumby wrote:The odd thing is I'm not deleting the file, I'm trying to move it into an empty folder in the trash.

Watch for file names with spaces, Linux can't move (mv) or cp(copy) them, and might not be even able to see the files
--you need to escape the file name character that is unusable by the OS or quote it as in 'mv _ MrData.txt'
--notice the space character after the underscore _ M, as well as letter case being significant (capitalized or lower case characters)

Move means copy and delete original
--otherwise how would a move be different from a copy operation
One trick using mv is to mv a file in its original position, a method of renaming a file
Last edited by DrHu on Tue Sep 22, 2009 4:00 pm, edited 3 times in total.

igorzwx
Level 5
Level 5
Posts: 597
Joined: Sat Sep 05, 2009 3:13 pm

Re: Can't empty trash completely

Postby igorzwx » Tue Sep 22, 2009 3:59 pm

This should work:

sudo apt-get install mc

Then type on terminal:

EDIT: This is universal command for any boxes:

mc ~/.local/share/Trash/files

*********************************************

mc /home/<your user name>/.local/share/Trash/files

EXAMPLE:

mc /home/igor/.local/share/Trash/files

Navigate to that file in Trash

Click on "Delete"

***************
EDIT: Fantastic! You can open your Trash with Nautilus as ordinary file in this way:

nautilus ~/.local/share/Trash/files

igorzwx
Level 5
Level 5
Posts: 597
Joined: Sat Sep 05, 2009 3:13 pm

Re: Can't empty trash completely

Postby igorzwx » Tue Sep 22, 2009 4:17 pm

Hi DrHu !

I believe MC will delete for sure.
It was always helpful in such cases.
Let us see.
Very interesting indeed.

igorzwx
Level 5
Level 5
Posts: 597
Joined: Sat Sep 05, 2009 3:13 pm

Re: Can't empty trash completely

Postby igorzwx » Tue Sep 22, 2009 5:48 pm

Corrected version:

sudo apt-get install mc

Then type on terminal:

mc ~/.local/share/Trash/files

This will open MC window inside the Terminal.

Navigate to that file in Trash.
Mark that file, which you want to delete.
Simply click on it, and it will be marked.

Click on the button "Delete" on the bottom of the Terminal window.

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Fri Sep 25, 2009 12:51 am

Thanks Igor, but I think I've decided to reinstall a new iso of Mint, as I have too many other problems, including bizarre spontaneous shutdowns and restarts. The reinstall should certainly wipe the trash can I would think!

igorzwx
Level 5
Level 5
Posts: 597
Joined: Sat Sep 05, 2009 3:13 pm

Re: Can't empty trash completely

Postby igorzwx » Fri Sep 25, 2009 5:54 am

QUOTE: "including bizarre spontaneous shutdowns and restarts."

It was, perhaps, restarts of Xorg, not of the system.
You have to login once more. Right?
I had this too.
It is the drivers problem.
You should fix your drivers in some way, perhaps.
A new installation makes sense, of course.

gumby
Level 3
Level 3
Posts: 154
Joined: Sun Feb 15, 2009 12:57 pm

Re: Can't empty trash completely

Postby gumby » Sun Sep 27, 2009 6:39 am

Igor,

MC didn't work. I can't even find the Trash file. It's not there. I looked under local/share. No trash.

But in Nautilus, it's still there. Right now I'm preparing to do a reinstall and having big problems because I'm trying to move a lot of files onto a different partition so I can reformat the first data partition as NTFS, but I don't have room because all the big multi-GB files I deleted are taking up too much space in the TRASH which I can't empty. Until the trash is emptied, the space is still regarded as occupied on the data partition.

I moved more big files to the trash to make room for this move and can't delete them from the trash, also can't delete them permanently.

I'm also worried that the system is behaving so bizarrely that it won't backup my data to DVD accurately. But I have more stuff than I can backup to dvd, which is why I wish I could delete these damn files from the trash.


Return to “Newbie Questions”

Who is online

Users browsing this forum: Google [Bot], Pastcal and 14 guests