I accidentally removed my Trash and can longer put items into it, how can I get it back?

Solution 1:

Try:

cd ~
mkdir .local/share/Trash
mkdir .local/share/Trash/expunged
mkdir .local/share/Trash/files
mkdir .local/share/Trash/info
chmod -R 700 .local/share/Trash

... and then restart nautilus with nautilus -q. I am not sure it will work, it is just recreating the structure I have with an empty trash; you can safely ignore error about existing directory.

Notice, no sudo here. The trash is yours, should be manageable without superuser privileges; as a general rule, you should never use sudo to manage file in your home directory --- unless you have to fix previous sudo usage, that is.

If you have messed with superuser in this dirs, you may need to fix the ownership...

sudo chown -R myuser .local/share/Trash

Where myuser is your normal user, of course.

And BTW, the "not erasable file" was probably a file in another partition.