LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 09-30-2012, 02:09 PM   #1
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Can't empty my /root/.local/Trash - need too badly


Have tried to do this a number of ways including remotely from another install.

If doing it locally I just get duplicate files generated in the bugger.

If doing it remotely I get a new .Trash generated in the / directory.

I am running Sid with xfce.

This problem also happens on my testing install.

Before you ask I will tell you that the reason for so much being in there is removal of a lot of files that had to do with other DEs that were not removed when the extra DEs were removed.

As this install has been here for some time this trash has accumulated to just under 9g. Trying to remove it has at least doubled the ammount in there so I have not really deleted that ammount of files.

I attempted, on a temporary install, changing the permissions to the user rather than root. This did not help in the least. Same results.

Any suggestions will be tried out, at least on some poor install that is only there to take abuse.
 
Old 09-30-2012, 03:23 PM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,674

Rep: Reputation: 122Reputation: 122
Log in into single-user mode, you'll get to the cli, then su into the root account. Then, issue the following command (copy/paste to prevent errors):
Code:
cd / && rm -R /root/.local/Trash && touch /root/.local/Trash
Check if it's gone:
Code:
ls -l /root/.local/Trash
The file should be empty (size=0), if not, report back the exact error code... If it worked, reboot by simply entering the "reboot" command.
 
Old 09-30-2012, 05:07 PM   #3
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Original Poster
Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Quote:
Originally Posted by Dutch Master View Post
Log in into single-user mode, you'll get to the cli, then su into the root account. Then, issue the following command (copy/paste to prevent errors):
Code:
cd / && rm -R /root/.local/Trash && touch /root/.local/Trash
Check if it's gone:
Code:
ls -l /root/.local/Trash
The file should be empty (size=0), if not, report back the exact error code... If it worked, reboot by simply entering the "reboot" command.
Sounds good, will give that a whack.

Be a bit before I can do that. Have a large download going for Mageia 3 alpha 2 and have to go to work for a couple hours anyway to fill the spray truck.

Will be this evening though. I will definitely be reporting back.
 
Old 09-30-2012, 05:57 PM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Quote:
Originally Posted by widget View Post
...
As this install has been here for some time this trash has accumulated to just under 9g. Trying to remove it has at least doubled the ammount in there so I have not really deleted that ammount of files.
.
A textbook example of exponential growth.

Glad your question was answered.
 
Old 09-30-2012, 06:29 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787
Quote:
Originally Posted by Dutch Master View Post
Code:
cd / && rm -R /root/.local/Trash && touch /root/.local/Trash
...that should work if it resides there and actually is a file and not, as I think it would be, a directory residing in $HOME/.local/share/. Unfortunately you've IMHO missed an opportunity to address the more important part. AFAIK $HOME/.local/ is the location where Desktop Environment-related applications have their files. This suggests the OP runs a DE as root user which should be discouraged for various reasons.
 
Old 09-30-2012, 07:52 PM   #6
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Original Poster
Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Quote:
Originally Posted by unSpawn View Post
...that should work if it resides there and actually is a file and not, as I think it would be, a directory residing in $HOME/.local/share/. Unfortunately you've IMHO missed an opportunity to address the more important part. AFAIK $HOME/.local/ is the location where Desktop Environment-related applications have their files. This suggests the OP runs a DE as root user which should be discouraged for various reasons.
Have not had time to fool with this yet, still downloading.

As for running as root, this is not the case. This is the root trash. I have no trouble with user land trash.

This is trash from / not /home.

These are files that were left over from Gnome when I switched to Xfce. I did not use purge as there were some things I wanted left. The files removed by going in and deleting them were not orphanned and so did not show up as removable. Many were recommends that I should not have installed in the first place.

I also had 6 Ubuntu ISOs in a directory that I created. Grub will boot ISOs if they have the correct hooks and some if you modify them correctly (haven't had any success with Debian yet). Ubuntu ISOs boot great from grub. Boots up about as fast as an install and also works about as fast. Not having any use for them I deleted them. ISOs are large files and this adds up pretty quickly.

I also have created a /usr/share/backgrounds directory, a legacy of using Ubuntu. This is convinient as I can put images there and easily move them to /usr/xfce4/backdrops for use as wallpaper. Occasionally I go through them and prune. Images also add up pretty quickly.

Also have a bad habit of collecting themes and icon sets. Even I have to admit that some of these need to go as they have never been used. These also add up.

Basically I need to do some more clean up and can't be having this much stuff just move to another file that I can't get rid of.
 
Old 09-30-2012, 10:03 PM   #7
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Original Poster
Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Not going to get to this tonight. Download is huge and slow.

Have to be at work a 6:30AM tomorrow too.

Did try and see if I could effect the testing installs (not near as bad as this one) / trash in chroot. Did not work.

Claimed there was no such file or directory. I can find them fine in Thunar.

Realizing after trying that I did not need to cd to / when I was already there in my chroot, installed on / and /home, I cut that part of the command out but it made no difference.

That is an interesting case over on testing as I just used a rm command, while logged into that install, to remove the /.local/Trash. It worked. Created a /.Trash directory and moved every thing there.
 
Old 10-01-2012, 12:35 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787Reputation: 2787
Quote:
Originally Posted by widget View Post
As for running as root, this is not the case. This is the root trash. I have no trouble with user land trash. This is trash from / not /home.
As far as I'm aware nobody is allowed to create directories or files directly under inode 2 (aka "/") but root...
 
Old 10-01-2012, 01:04 AM   #9
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Original Poster
Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
This is true.

It is fairly easy to get access to create say a /etc/aa directory to store Live images for booting.

On the other hand, unless you are installed on one partition (/) you will not be booting those images with grub. They must be in a / partition as that is the only place that grub will recognize them.

If you are using grub-pc and want to use the /etc/grub.d/40_custom file as intended you need to put your custom entries in it and then save that file as something like 06_custom. This will put the menuentry(s) at the top of the screen menu.

If all you use is custom entries, which makes the screen menu come up a lot faster if you are multi booting, you may not want to have all menu items available at all times, such as ISO menu entries. In that case you once more populate 40_custom with those entries and save it as 07_custom. Now when you boot, if 06 and 07 are enabled to execute, you will have the 06 menu entries on top and the 07 entries on the bottom of the screen menu.

If you are not playing with or installing Live images there is no sense in having them on the menu. Disable 07 and then the ISO entries are not there (after, of coarse, running update-grub). The same is true if you are, for some reason, not going to be booting to an install for a day or two. Leave 07 and disable 06.

You may wish to boot to another drive sometimes. In which case a 08_custom file can hold those entries for those times.

There are many other reasons you may wish to create files and even directories in /. Or remove them for that matter.

It is impossible to set up a remastersys ISO without adding directories to /etc/skel. If you want to modify the way a new users /home/<user name> is set up you need to modify or add or remove some of the /root/.hidden files.

These are all perfectly valid reasons to be doing these things.

What is strange here is the refusal of the root trash to refuse to be permenantly deleted. Works in Squeeze, at least on my installs of Gnome and OpenBox Squeeze.
 
Old 10-03-2012, 07:15 AM   #10
VDP76
Member
 
Registered: Apr 2010
Location: Bayreuth, Germany
Distribution: CrunchBang Linux (#!)
Posts: 111

Rep: Reputation: 19
hi widget,
have you considered trying to boot from some live cd, mount your / partition and see if you can delete those file from there!?
 
Old 10-03-2012, 07:46 AM   #11
lazylogic
Member
 
Registered: Aug 2006
Posts: 145

Rep: Reputation: 16
What Dutch Master suggest should do the magic.

Bleachbit should also do the job though.
 
Old 10-03-2012, 11:41 AM   #12
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Original Poster
Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
I finally gave up on the download. Got most of it but I think my connection is too slow for their server. Believe it timed me out.

Been busier than a one armed paper hanger at work but think I will get to this tonight. Just popped in at home for a quick bite. Need to get anti freeze in the spray rigs as it is supposed to be 21 degrees (F) tonight. Have 3 200 gallon rigs, one that needs cleaned out first and 2 25 gallon rigs for four wheelers that need protected, one of them also needs removed from the 4 wheeler it is mounted on. Tried to tell the boss we needed to do this a couple days ago but that didn't fly. It will get done though and everything will be fine.

If the commands don't do the job I seriously doubt that bleachbit would either. It would have at least as much trouble with permissions as core linux command line commands will. Will keep it in mind though. Have never felt the need to use it. Might be fun to try it out.
 
Old 10-03-2012, 06:51 PM   #13
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Original Poster
Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
What fun, an 12 hour work day.

More FUN, coming home whipped and getting rid of a bunch of reluctant root owned trash files. Had a /root/.local/share/Trash. Gone. Had a /.Trash-0. Gone.

And for some reason had a /home/.Trash-0 that I had never seen before. Gone.

Just like that I have 23.38Gib unused in / according to gparted. Was something like 8.

@Dutch Master
The next time you are in Montana, or even close, I really owe you a brew or 4. Thanks a bunch. Have tried this before and it didn't work. Was just using "rm" and it just moved stuff to that /.Trash-0. The "-R" seems to have been the key here.

Just booted to an OpenBox root session and things went great. Better get out of here before I "improve" something.
 
Old 10-04-2012, 12:04 AM   #14
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,674

Rep: Reputation: 122Reputation: 122
Glad you solved it, though it's unlikely you'll find me in Montana anytime soon The -R option is recursive, it deletes all files, no questions asked, no backups/un-delete options or whatever. You should have found it if you studied the man page for rm
 
Old 10-04-2012, 08:43 AM   #15
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,200

Original Poster
Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Quote:
Originally Posted by Dutch Master View Post
Glad you solved it, though it's unlikely you'll find me in Montana anytime soon The -R option is recursive, it deletes all files, no questions asked, no backups/un-delete options or whatever. You should have found it if you studied the man page for rm
Yes I should have and even wondered about it because of its use with chown. Just getting slow in my old age I guess (good excuses are hard to come by).

Thanks again.

Hopefully will not need to be doing this again. Used several DEs trying them out intensively when switching away from Gnome. Between that an the ISOs it added right up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Empty Trash FredGSanford Mandriva 5 03-01-2011 09:16 PM
How to open the trash folder and empty the trash in command line cmx08 Linux - Newbie 5 08-29-2008 09:15 AM
Can't empty the trash. MooseMagnet Linux - Newbie 29 12-21-2007 09:49 AM
Move to trash works beautifully, but empty trash .. different story. kd5eax Mandriva 2 12-04-2007 02:52 PM
empty trash Moleman Linux - Software 1 05-16-2003 12:23 PM


All times are GMT -5. The time now is 07:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration