Solved Clear trash - nothing happens

Solved issue

damix9

Member
Joined
Jun 5, 2024
Messages
47
Reaction score
12
Credits
415
Code:
$ inxi -S
System:    Host: ryzen Kernel: 5.4.0-135-generic x86_64 bits: 64 Desktop: KDE Plasma 5.12.6
Distro: Ubuntu 18.04.1 LTS
In Dolphin I open trash:/ then right click -> empty trash. Context menu disappears, files remain. I expect files to be deleted.
I know the distro is unsupported, I'm going to install a new one, I'm just cleaning my PC before migration.

P.S.
I repeated it several times and some files got deleted, their total size in the trash as shown by Dolphin was 12Gb, and then became 7Gb. But when I repeat clicking "empty trash" now, no more files are deleted.
 
Last edited:


rm -r $HOME/.Trash/*
rm -r $HOME/.local/share/Trash/*
^ Will be one of those depending on your system... Open it in your file manager, you'll see. There may be subdirs like "Files", "Apps", "Info" and such that'll just keep respawning. Nothing you can do except disable Trash or Shift+Delete everything like I do... That said, if you're not on a backup system of sorts, make sure you know you really want to delete it because EXT4 undelete tools have never worked well for me. I think NTFS has the upper hand there... Though it's not really the upper hand if you don't want people creeping and snooping on your deleted love letters, slam poetry, and pr0n. Ofc that's when you use dd over the file instead, lol
 
I use KDE 5 and found the trash directories here:

~/.local/share/Trash $ ls -alR
.:
total 20
drwx------ 5 trenix trenix 4096 Oct 12 2021 .
drwx------ 64 trenix trenix 4096 Nov 4 08:52 ..
drwx------ 2 trenix trenix 4096 Dec 2 2020 expunged
drwx------ 2 trenix trenix 4096 Sep 24 23:55 files
drwx------ 2 trenix trenix 4096 Sep 24 23:55 info

./expunged:
total 8
drwx------ 2 trenix trenix 4096 Dec 2 2020 .
drwx------ 5 trenix trenix 4096 Oct 12 2021 ..

./files:
total 8
drwx------ 2 trenix trenix 4096 Sep 24 23:55 .
drwx------ 5 trenix trenix 4096 Oct 12 2021 ..

./info:
total 8
drwx------ 2 trenix trenix 4096 Sep 24 23:55 .
drwx------ 5 trenix trenix 4096 Oct 12 2021 ..
~/.local/share/Trash $

You could do something like this:

Code:
#!/bin/bash

if [ -d "~/.local/share/Trash/expunged" ]; then
     cd ~/.local/share/Trash/expunged
     rm -rf *
fi

if [ -d "~/.local/share/Trash/files" ]; then
     cd ~/.local/share/Trash/files
     rm -rf *
fi

if [ -d "~/.local/share/Trash/info" ]; then
     cd ~/.local/share/Trash/info
     rm -rf *
fi

exit 0

# EOF

Signed,

Matthew Campbell
 
After that you could create a desktop application called Empty Trash using that script I just wrote if saved in ~/bin/empty_trash and set both files to 0700. Store this desktop file in ~/.local/share/applications/empty_trash.desktop:

Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Comment[en_US]=
Comment=
Exec=~/bin/empty_trash
GenericName[en_US]=
GenericName=
Icon=/usr/share/icons/Adwaita/256x256/legacy/edit-delete.png
MimeType=
Name[en_US]=Empty Trash
Name=Empty Trash
Path=~/
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-Substitute-UID=false
X-KDE-Username=
Version=1.0

This presumes that you have the Adwaita icons installed on your system. If you don't then you can pick a different icon.

Then open the KDE menu using the icon in the bottom left corner of your screen, provided you have the bottom panel installed in your DE, and search for Empty and the Empty Trash option should appear. Left click on this option and click on the Add to Favorites to have it listed in your Favorites menu.

Signed,

Matthew Campbell
 
@Condobloke Well played ;)

@damix9 The reason could be literally anything without giving us more specific info. You say the menu dissappears. Was it "clicked"? Do you know if the correct action is sent? What do you mean "distro is unsupported"? ... ad infinitum... Try running Dolphin from a terminal and the emptying the trash. Post the output in [spoiler ] and [code ] tags. Look for stuff like dbus errors as you go through you log.
 
@Condobloke, is it forbidden to discuss unsupported distros here or you mean it's ok to use the workaround?

without giving us more specific info
I gave it. If you need more, give me the commands needed I'm able to copy paste their outputs.

Was it "clicked"?
Yes, I wrote right click -> empty trash.
Do you know if the correct action is sent?
No, how to check?
What do you mean "distro is unsupported"?
Literally it.
Try running Dolphin from a terminal and the emptying the trash.
Code:
$ dolphin 
kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find "stash"
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/today")
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/yesterday")
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/thismonth")
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/lastmonth")
org.kde.dolphin: Ignore KIO url: QUrl("search:/documents")
org.kde.dolphin: Ignore KIO url: QUrl("search:/images")
org.kde.dolphin: Ignore KIO url: QUrl("search:/audio")
org.kde.dolphin: Ignore KIO url: QUrl("search:/videos")
qt.accessibility.core: Cannot create accessible child interface for object:  PlacesView(0x55feddd41a30)  index:  11
kf5.kio.core: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf\nLoaded services file OK.\nWARNING: You have some share names that are longer than 12 characters.\nThese may not be accessible to some older clients.\n(Eg. Windows9x,
WindowsMe, and smbclient prior to Samba 3.0.)\n"                                                                                                                                                                                                                               
Aborting aboutToFinish handling.                                                                                                                                                                                                                                               
^C
The last line was added when emptying the trash.
Post the output in [spoiler ] and [code ] tags.
I'm not a dummy :) Btw this forum has very good engine. WYSIWYG message editor is very convenient.
 
@Condobloke, is it forbidden to discuss unsupported distros here or you mean it's ok to use the workaround?


I gave it. If you need more, give me the commands needed I'm able to copy paste their outputs.


Yes, I wrote right click -> empty trash.

No, how to check?

Literally it.

Code:
$ dolphin
kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find "stash"
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/today")
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/yesterday")
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/thismonth")
org.kde.dolphin: Ignore KIO url: QUrl("timeline:/lastmonth")
org.kde.dolphin: Ignore KIO url: QUrl("search:/documents")
org.kde.dolphin: Ignore KIO url: QUrl("search:/images")
org.kde.dolphin: Ignore KIO url: QUrl("search:/audio")
org.kde.dolphin: Ignore KIO url: QUrl("search:/videos")
qt.accessibility.core: Cannot create accessible child interface for object:  PlacesView(0x55feddd41a30)  index:  11
kf5.kio.core: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf\nLoaded services file OK.\nWARNING: You have some share names that are longer than 12 characters.\nThese may not be accessible to some older clients.\n(Eg. Windows9x,
WindowsMe, and smbclient prior to Samba 3.0.)\n"                                                                                                                                                                                                                              
Aborting aboutToFinish handling.                                                                                                                                                                                                                                              
^C
The last line was added when emptying the trash.

I'm not a dummy :) Btw this forum has very good engine. WYSIWYG message editor is very convenient.
Okay, when I said specific info, I meant running the app in a terminal, or using strace <app name here>, etc. as system calls are important indicators.
When I asked if it was "clicked" I didn't mean whether you clicked it, I meant whether the window registered the event and if the correct signal/event was sent.
...And yes, I didn't notice Ubuntu was 18 in your output and when I saw "unsupported", I thought, WTF? -- that's on me.

In this case, I strongly suggest you just upgrade to the latest LTS and call it a day.

That said, I'll try to troubleshoot this:
So that mostly, based on that output, it looks like you're doing this on a share which is a very different beast than locally. KDE has its own "way of doing things" making it that much harder. Also, minor thing, but try upgrading Qt -- minor thing just as GTK warnings, but all the same.

As for actual remediation, I'd backup my KDE configs, reboot into a CLI, and then uninstall a'la --purge KDE completely, then ensure you samba configuration is correct (currently I see no issues, just complaints about names, but you may want to check things in any case). Once you are sure it all works properly, reinstall KDE and install all suggested packages --install-suggests (I think this should fix missing things and work on Ubuntu, too).

But to reiterate, if your system is that out of date, it doesn't matter whether that's the cause or not, I encourage you to upgrade for security and stability reasons. Really, you will get more and more issues if you stay on an EOL system... If you don't like re-installing, move to a rolling release like Fedora, or try anything based on Debian Testing (which is more/less reliable for a desktop -- put it this way, AFAIK, many Ubuntu packages come from Debian Sid). Ultimately, my best advice is suck it up and do a reinstall every couple years. It ensures no upgrade debris, it gives you a clean start, and in many distros' cases, gives you a stable repo snapshot which is only updated to reflect well-tested upgrade packages.

PS: Never thought you were an idiot, just that most people who haven't been here too long tend to not be bothered (as in lazy, need reminding) and with long outputs, [spoiler ] tags keep posts neat and [code ] tags are there to maintain formatting, so you can imagine how messy things get.
 
Code:
$ inxi -S
System:    Host: ryzen Kernel: 5.4.0-135-generic x86_64 bits: 64 Desktop: KDE Plasma 5.12.6
Distro: Ubuntu 18.04.1 LTS
In Dolphin I open trash:/ then right click -> empty trash. Context menu disappears, files remain. I expect files to be deleted.
I know the distro is unsupported, I'm going to install a new one, I'm just cleaning my PC before migration.

P.S.
I repeated it several times and some files got deleted, their total size in the trash as shown by Dolphin was 12Gb, and then became 7Gb. But when I repeat clicking "empty trash" now, no more files are deleted.
rm -rf ~/.local/share/Trash/* (Try This)
 
upgrade to the latest LTS
I won't use Ubuntu anymore, I'll install a normal distro. But it doesn't matter.

So that mostly, based on that output, it looks like you're doing this on a share which is a very different beast than locally.
No, it's locally.

You mean I shouldn't worry about it and should just rm the trash manually? I agree, I just wondered why it happens.
 
I won't use Ubuntu anymore, I'll install a normal distro. But it doesn't matter.
Can't say I blame you. Ubuntu started slipping back in the 20-teens already. Mint seems to fix a lot of Ubuntu issues, but it's still downstream. So if you want the purest, it's Debian, 'stable' for a solid system, or 'testing' for a rolling release. You could go Fedora, too in the latter case, and TBH if Fedora checked just a few more boxes that running a stable branch Debian did, I'd quit Debian because I disagree with many choices made re packaging as it stands, but that's just me having issues as is my wont.

No, it's locally.
Weird that as the SMB error indicates a config file exists.

You mean I shouldn't worry about it and should just rm the trash manually? I agree, I just wondered why it happens.
I'd just do it manually. "Shortest distance between two points" as they say. You can automate it as a cronjob or have it run whenever you login, close dolphin, etc. IIRC dolphin supports custom R-click actions so you could just add a menu item for "PermaDelete" (I did this with Thunar so I have a delete and trash option).
 
Ubuntu started slipping back in the 20-teens already.
In 2016. The last working OS was 14.04. 16.04 - not on all hardware, 18.04 is completely crappy. And now, since it switched to Wayland, it doesn't exist for me anymore.
Debian, 'stable' for a solid system
Debian is also bad for desktop (for server it's ok). It seems to be a little bit more debugged, but they still broke hibernation on 6935G. It doesn't work even in oldstable. Their stability is fake and it's a well-known fact. And they don't have firmware for
BCM20702A0. However even unpopular ALT Linux has a package for it. And Debian lacks many other packages.
SMB error indicates a config file exists.
It exists. I have an SMB share on this PC.
I'd just do it manually.
Ok, I did it. I'm going to remove this OS anyway.
You can automate it as a cronjob or have it run whenever you login, close dolphin, etc.
I disagree with this approach. It's a dirty hack. If I installed a new OS and found a problem like this I would make sure I do everything right, and if so, if it's not a misconfiguration, report that as a bug and stop using that distro if they don't fix it. Trash should work out of the box in a modern OS.
 
most people who haven't been here too long tend to not be bothered (as in lazy, need reminding) and with long outputs, [spoiler ] tags keep posts neat and [code ] tags are there to maintain formatting, so you can imagine how messy things get
Oh I know what you feel. I've used IT-related forums a lot and it's very annoying when newbies ignore markup.
 
@Condobloke, is it forbidden to discuss unsupported distros here
That seems a bit of a knee jerk reaction. I did not use the word 'forbidden'.

Just keep in mind that you introduced the fact that the distro is unsupported.......""The reason for this is that it is now out of support and no longer receiving updates and security patches.""......and the "fallout" from this lack of support is unknown.

Who would be better experienced to discuss such a thing, let alone decide "" the reason of this problem and how to really fix it?""

Certainly not me.;)
 
Debian is also bad for desktop (for server it's ok). It seems to be a little bit more debugged, but they still broke hibernation on 6935G. It doesn't work even in oldstable. Their stability is fake and it's a well-known fact. And they don't have firmware for
BCM20702A0. However even unpopular ALT Linux has a package for it. And Debian lacks many other packages.
RE: Packages
I don't think you understand the Debian ecosystem. It may appear to have less packages because a fresh install will have have on the bare minimum non-free stuff. In order to get "everything", one needs to enable 'contrib' 'non-free' and 'non-free-firmware' (split was recent) in apt. Reason: Debian is very anti-proprietary. Whereas distros like Arch and Ubuntu take the pragmatic approach of, "Well, if it works, who cares about a little non-free stuff?" Debian takes the ideological approach of, "OMG, we do not even install Nvidia drivers by default, happy nouveau'ing." Okay. Now Ubuntu has about 10k more packages, but a lot of this is proprietary. PPAs are not part of Ubuntu's official repo, thus I'm not counting them -- and they'll soon be obsoleted by Flatpak. Arch has less packages than many distros in the official repo, at about 10k, however the AUR does contain probably in the region of 60k or more. However it's tough to call AUR out because that is basically the very purpose of Arch.
Though Package counts mean nothing...
Counts depend on how things are packaged. Some distros will place [App] + [App core plugins] into a single package, others may separate them. However that's not really the point. The point is that between Flathub and Appimages, there's almost no distribution-exclusive package. And remember there's always the build from source option.

RE: Stability
"Their stability is fake" is probably the most fallacious statement I've heard today. And "a well-know fact" is something I really hate people say as a substitute for real citations.
First you need to understand the meaning of "stable": that packages in the current "stable" branch will not break each other. And they made so sure of that, that it's sometimes a PITA to remove packages because of dependencies. I personally disagree with how OTT it's gotten, but it achieves its purpose. Note that hardware support, etc. has nothing to do with the stability referred to in any Linux context. The fact that you would think a driver from oldstable would work better for your hardware is kinda proof you didn't understand this, so I'm just educating you.

RE: Drivers

It is true, Linux in general does not always get the support that's needed. But this is not the fault of anyone but hardware manufacturers who're too lazy to support anything but Windows. Users of other OSes are left reverse-engineering windows drivers, and dumping firmware from the devices themselves. Now, Debian is usually behind a little on drivers and the reason for that is their release model. However, important firmware updates are released via updates and every driver for linux is available on any distro because it can be built from source packages (even if those packages contain a few prebuilt binaries). And I'm pretty sure you hibernate/suspend issue is solved or solvable as I just checked that model and it's 2008. As for Broadcom, they have a history of sticking it to to Linux users, but you may find even Windows users got screwed this time. And what dya know, there's an easy fix on Debian's website. Although I have never had issues where I've even come close to converting Windows blobs.
At most, I've had to build a couple of drivers in the early days. Everything on Linux has "just worked" for me for years now, old and new hardware alike.

...and thanks for making me do and entire essay.
 
Last edited:
It exists. I have an SMB share on this PC.
Eeyup.

Ok, I did it. I'm going to remove this OS anyway.
Good. That's the smart thing to do ;)

I disagree with this approach. It's a dirty hack. If I installed a new OS and found a problem like this I would make sure I do everything right, and if so, if it's not a misconfiguration, report that as a bug and stop using that distro if they don't fix it. Trash should work out of the box in a modern OS.
I agree. And so long as you're using the most updated stable version of a software package, things generally tend to work fine, unless they're misconfigured.

Anyway, good luck with your new install. May I recommend going with Mint as they iron out most creases and Mint is both user-friendly and pretty difficult to break.
 
Last edited:
they'll soon be obsoleted by Flatpak
Flatpak is unusable. You can't even "Open with" in it.
Though Package counts mean nothing...
Counts depend on how things are packaged. Some distros will place [App] + [App core plugins] into a single package, others may separate them.
You are right. I count apps I need, not packages.
However that's not really the point. The point is that between Flathub and Appimages, there's almost no distribution-exclusive package.
What do mean? That one can use self-contained software (shipped with libs, don't know if it's correct term) and not to care about what's packaged in their distro? I agree. And self-contained software is good. AppImage is good. Flatpak is just a bad implementation of a good idea.

"Their stability is fake" is probably the most fallacious statement I've heard today.
Under stability I mean having less bugs. I know they mean a different thing, so that's why I call it a fake. I don't mean they cheat or something ...
And I'm pretty sure you hibernate/suspend issue is solved or solvable as I just checked that model and it's 2008
It's solvable by building kernel from source or downgrading the kernel to 4.4. But it's not what a user expects. It's still a bug.
And what dya know, there's an easy fix on Debian's website.
I did it. It's not easy and it's not the way it should be done. It can't be packaged due to license issues, but ALT made a package that automatically downloads this firmware from some third-party source, so the user can just install the package.
 
Last edited:
Flatpak is unusable. You can't even "Open with" in it.
Yes you can, just go to the equivalent "preferred applications" in you DE or use xdg from the CLI. Appimages also require additional steps like creating desktop files / registering the app. (I'd recomment a system-wide install in this case).

What do mean? That one can use self-contained software (shipped with libs, don't know if it's correct term) and not to care about what's packaged in their distro? I agree. And self-contained software is good. AppImage is good. Flatpak is just a bad implementation of a good idea.
I agree that Appimages are better, but that's because I like the self-contained approach as is makes them pragmatically easier to isolate. Flatpak is a convenience for some users as it provides an easy install process. I don't use it but I'm glad it's around. It ensures packages are available regardless of what distro you're on. Not everyone has the time or know-how to build from source or create Appimages from existing packages or source.

Under stability I mean having less bugs. I know they mean a different thing, so that's why I call it a fake. I don't mean they cheat or something ...
It's not "fake". The term "stable" means the same thing across the Linux ecosystem. It means packages not breaking each other. In other words, no bugs in the OS. Hardware issues are not part of this equation.

It's solvable by building kernel from source or downgrading the kernel to 4.4. But it's not what a user expects. It's still a bug.
You don't need to do either. In fact the more modern the kernel, the more likely it is to be built-in as opposed to a dynamic module and the more likely there's a free implementation made by reverse-engineering existing drivers.

I did it. It's not easy and it's not the way it should be done. It can't be packaged due to license issues, but ALT made a package that automatically downloads this firmware from some third-party source, so the user can just install the package.
I use the term "easy" relatively. To someone who already has drivers on Windows, it's easier than looking for the driver online. And keep in mind how many Windows users need to visit OEM websites for drivers. This has been the norm since forever. The existence of license issues, if that's the case, kinda relieves any distro of responsibility in supporting something. But if you like the ALT approach, just look online and find a script that does that or write one yourself. That's what makes Arch so popular; community involvement. Bottom line is the onus is on OEMs to provide support for other OSes, not kernel developers, and not individual distros.

I hope this clears up any confusion about the way the Linux ecosystem works.
 

Members online


Latest posts

Top