[SOLVED] Whats proper way to delete /root/.local/share/Trash
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Whats proper way to delete /root/.local/share/Trash
I searched for how to delete my root trash and it is a lot more confusing than I would expect it to be. I ended up deleting the entire Trash directory by mistake. I then read that next time I delete something as root user the directory would reappear. It did not. Sooo, do I simply do
Code:
mkdir /root/.local/share/Trash
Then what is the proper way to delete my root trash? I am full up from all the stuff in trash. Even though I deleted the root trash I still have no space left in my root partition.
Last edited by sofasurfer; 01-19-2023 at 06:36 PM.
That dir would be just the files your deleted manually, like a normal user, which would usually be very few.
Please run the following cmds
Code:
df -h
lsblk
If this is a stock default home install, it's quite likely that the root partition ( '/') also contains /var/log where the logfiles are .
This is likely but not definitively where your space has gone.
The above cmds will help us find out...
Are you using a command line trash tool or actually logging in to a desktop as root? Since typically root does not use the desktop with most distributions now days there isn't a Trash directory. With a regular user it depends on the desktop version but either there is a trash icon or you can delete trash from the file browser.
There is the trash-cli tool that uses the same trash environment as the desktops but has its own commands to delete, restore etc.
There are lots of reason the root partition is full besides a lot of trash.
I've never had a /root/.local/share/Trash/ directory. I can't imagine a legitimate admin user having need for one. Delete should mean delete, not relocate junk to some other directory, when maintaining a system, especially when there is a space problem on /. A file manager should be selected on its ability to facilitate deleting what needs deleting.
To locate wasted space, try using ncdu. Once you know where the culprits are, try using mc to free the space they waste.
The place to start looking may be the cache your package manager uses in /var/. You might have more space consumed there than anywhere else, if it hasn't been managed and the system has been in use more than a year or two's worth of updating. Another place to look, if it exists, is /var/log/journal/'s subdirectory(s). Anything there more than several weeks or maybe a few months old you'll probably never have a use for. Equally useless, though not such a big waster, are .xz files in /var/log/. Odds are you'll never need those either after a few weeks of age, if ever.
I am using Ubuntu 20.04 with Gnome desktop. Thanks for your replies. Let me be clear, I am referring to /root/.local/share/Trash
It does exist. My / directory was full. I looked at my local (user) trash on the desktop and noticed that a bunch of iso files that I had deleted were not in there. I has previously had them in the / directory and then deleted them. So I searched for "trash" and located the /root/.local/share/Trash directory. There I found the iso files. Here is the ls output (I am currently finding this lost info on my clone backup)...
Code:
$ sudo ls -a /root/.local/share/Trash/files
. foxclone_std-50-06.iso
.. systemrescue-9.05-amd64.iso
AAAAAfoxclone44-05.iso systemrescue.iso
Afoxclone44-05.iso testdebian-live.2.iso
debian-live-11.2.5.0-amd64-cinnamon.iso testdebian-live.3.iso
debian-live-11.5.0-amd64-cinnamon.iso testdebian-live.iso
foxclone_edge50-07.iso
So I deleted the /root/.local/share/Trash directory thinking that when I delete something from / again the directory will be recreated...It was not.
So first I would like you guys to acknowledge that the /root trash directory exists and then tell me what I should have done properly to empty it. Why was a new Trash directory not created when I deleted more stuff from / directory?
MADEINGERMANY...Are you saying that $ trash-empty will empty local trash AND /root trash?
P.S. I have regained my lost space after all. I was mistaken to think I did not. But the above questions still are relevant.
Last edited by sofasurfer; 01-20-2023 at 04:35 PM.
Normally Trash does not exist for root but if you used the file manager or other GUI app to move files to trash as root via su or sudo -i then yes the root trash directory will be created. In the same manner you can delete the root's trash. trash-cli consists of trash-empty, trash-put, trash-rm, trash-restore and trash-list utilities which uses the same trash directory as the desktop. I don't know if it will create Trash if it doesn't exist.
If you delete files using the file browser as your regular user then they will go in the user's Trash directory and you can delete them from the trash can using the file browser when you select trash or you can can just delete the directories in the Trash directory from the cli.
Using rm does not put files in trash unless you have some alias that runs as a replacement.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.