KDE Dolphin error The trash is not available for this item’s location. Permanently delete it instead?

KDE Dolphin error “The trash is not available for this item’s location. Permanently delete it instead?” when trying to move-to-trash a file from /opt/

It is not quite clear what you are doing. Dolphin is an end-user GUI program and and end-user can not normally delete/move/create files in /opt.
Thus it may be that you are using “Dolphin in Super-user mode”. But you do not explain that.

In any case, when you do use Dolphin as root, then the trash of root’s desktop environment should be used as the trash. But it does not exist as root has not desktop environment.

Of course you can delete the file (as root), or, when you are not sure you need it again, move/rename it.

Don’t worry about that. I use opt for my own organization purposes. Permissions are the way I want.

What’s the “the trash is not available” error mean?

Trash is meant to be for the user’s homedir.

I though I explained that. root has no trash.

@8876523450:

Tim, by default the KDE Plasma Trash is as follows – with SELinux configured as indicated – possibly also your case on a Tumbleweed system – here on Leap 16.0 with SELinux activated and, per user groups defined:

 > ls -ldZ .local/share/Trash
drwxr-xr-x. 4 xxx xxx system_u:object_r:user_home_t:s0 31 25. Okt 16:31 .local/share/Trash
 > ls -ldZ .local/share/Trash/*
drwxr-xr-x. 2 xxx xxx system_u:object_r:user_home_t:s0 6 25. Okt 16:31 .local/share/Trash/files
drwxr-xr-x. 2 xxx xxx system_u:object_r:user_home_t:s0 6 25. Okt 16:31 .local/share/Trash/info
 >

Could it possibly be that, with your setup where the Trash directory is under ‘/opt’ – that the SELinux configuration hasn’t been correctly setup for the user directories at that location?

Henk, you’re not wrong – tho’ I must admit that, I’ve never logged in as “root” on this Leap 16.0 SELinux system with a KDE Plasma Wayland session – at least, not yet …

 # ls -ldZ .local/share
drwx------. 8 root root system_u:object_r:data_home_t:s0 4096 22. Aug 09:39 .local/share
 # ls -ldZ .local/share/*
drwxr-xr-x. 4 root root system_u:object_r:data_home_t:s0 4096 13. Okt 16:28 .local/share/flatpak
drwx------. 2 root root system_u:object_r:data_home_t:s0 4096  7. Feb 2025  .local/share/fonts
drwx------. 2 root root system_u:object_r:data_home_t:s0 4096 22. Dez 15:44 .local/share/gvfs-metadata
drwxr-xr-x. 2 root root system_u:object_r:data_home_t:s0 4096 14. Apr 2025  .local/share/inxi
drwxr-xr-x. 2 root root system_u:object_r:data_home_t:s0 4096 14. Mär 2024  .local/share/konsole
drwxr-xr-x. 2 root root system_u:object_r:data_home_t:s0 4096 14. Feb 2025  .local/share/RecentDocuments
 #

@8876523450:

Tim, I’ve check the KDE Plasma «still 5» documentation and this system’s KDE Plasma 6 Dolphin settings – I can’t find anywhere, the possibility to move a user’s Trash away from the default location of ‘~/.local/share/Trash’ …

  • Yes, yes, “~/.config/ktrashrc” may possibly allow the default location to be defined as something somewhere else but, I doubt that, such an action would be reliable …

It means that a directory is not on the same filesystem as your home directory, so files and directories can’t simply be moved from there to your trash directory in your home directory.

One option is to copy them there and delete them in their original location (which IMHO is kind of absurd - copy when deleting). The other one is to create a dedicated trash directory on that filesystem, like /opt/.Trash-1000 (1000 being your $UID) owned by you with the “sticky” bit set (very much like /tmp) to ensure only you can remove a file or directory from there.

If you use this often, it makes sense to set up that trash directory.

See also

For interest, I use /opt for games, and often for Windows games through Wine. Strangely, those games are now having trouble viewing files saved within the /opt/… path.

[quote=“8876523450, post:10, topic:190622”]
Strangely, those games are now having trouble viewing files saved within the /opt/… path.
[/quotte]

knurpht@Lenovo-P16:~/projects/openSUSE/audioknob-gui> ls -ld /opt
dr-xr-xr-x 1 root root 78  2 mrt  2025 /opt

You were right in your guess: file permissions had slipped from what I had working.

TIP: Never Ever change perms of system files/folders. The system should not hold user data.