Comment by GTP
AFAIK a library doesn't really require maintenance, unless there are extreme weather conditions, the books will survive for a long time on their own. It's only the ancient books that require a controlled environment, because they already lasted for centuries and we're trying to have them last for even more due to their historical value. So you would be able to keep libraries around for long in many (most?) scenarios. Instead, the devices you need to read those storage media require high-tech factories to be manufactured. Just having the instructions to build one will not suffice.
How long? I don't think a library would last more than 100,000 years given natural disasters and plate tectonics etc. All you need to do is make a reading device that can last for a similar amount of time. And if the device itself wouldn't last that long then you could provide as much long-lasting equipment or material as possible to help build it.
The scenario you're describing is incredibly specific. It requires a post-apocalyptic world where humans have survived, but have somehow completely lost all ability to access past knowledge. Civilization must be advanced enough to access and read a library that has been shielded from the elements for millennia, but not advanced enough to build microscopes or lasers, even when given precise instructions on how to do so. It must be far enough into the future that any possible small high-tech reading device we could create is unlikely to have survived, but not so far into the future that a very large library structure is likely to have collapsed.