There is one more quick way to remove empty/unused layers.
You just create new empty drawing. Then you select all objects in your original drawing and copy them to the new empty drawing. Only used layers are created in the list of layers of the new drawing.
Hey, that's a very good trick!
But keep in mind that in LibreCAD V2.1.3 you will lose the hatches (bug, solved in 2.2.0). Also you will have to take care that the new empty drawing has the same settings in Current Drawing Preferences.
So in further development of your trick, I had the thought, why not re-import to the same, but cleaned up drawing?
Instead of Copy, use Cut. Then, if you are lucky to have V 2.2.0 rc, you can delete all the layers, except 0, in one go. And then Paste back the contents including the used layers only.
unfortunatelly the selection of more than one layers does not work for me.
I am using windows version of LibreCAD 2.0.11
I supose, based on the look of your dialog window, that you are using LibreCAD in Linux system.
Maybe the list of layers has more functions under Linux or there another glitch which I am not aware of.
If you know anything about it, please let me know.