I don’t k kw about paper books lasting millennia. If you want to preserve books for millennia, you should carve them onto clay tablets and then bake them. The resulting baked clay tablets are pretty durable, even compared to the best paper.
Ask a real historian or research librarian about all the really important books that we know existed, but do not have, because there was no Devout Brothers of Document Preservation faithfully maintaining copies of them through the centuries.
But second, no, physical libraries generally don't last for centuries and certainly almost never for millenia. They get sold off, torn down, they burn down, and so on.
On the other hand, you can keep an entire copy of Library Genesis on a home computer if you want. The sheer number of digital copies means none of this is going anywhere.
And if the grid goes down and society is collapsing, then a collection of a good proportion of the world's books on your hard drive powered by a generator is going to be infinitely more valuable than some physical library you have to hike for days to get to with a chance that raiders will kill you on the way. ;)
The beauty of digital libraries is (if they are free) endless copies can be made. That's where real longevity stems from.
Besides, to read one's digital library requires a tablet and a solar charger.
Unfortunately this is demonstrably not the case with libraries’ current digital offerings. Not only are endless copies not allowed to be made, they often are more costly and have a limited amount of borrowings allowed of them.
https://www.wgbh.org/news/local-news/2020/01/06/inside-the-e...