There are about four solutions that have actually worked in history
Interestingly, this is not just a hypothetical question. Librarians and archivists already seriously study how they can preserve documents for centuries.
An example of an important case that has received a lot of attention is that of blueprints for major pieces of highly durable infrastructure, which might be expected to interact with the development of a city for centuries. The general conclusion is that there are currently no electronic methods that are reliable on anything approaching this time frame, so the first step is always to get digital blueprints transferred to (archival quality) traditional media.
Once you have that, well, there are quite a few examples of libraries of books preserved for 500 years. There are a few examples of much, much older books.
1. The desert method
As you already observed, dryness helps to preserve books. There are three main things that destroy books -- although their relative importance depends on the material used for the pages.
a. Some modern papers inherently self-destruct from chemical break down. This was much less of an issue before pulp paper was developed in the nineteenth century, but always has some effect, and may be exacerbated by exposure to light. However, these reactions require the presence of water. Keeping the paper (or papyrus, etc.) extremely dry will slow them down immensely.
b. Insect and vermin attack can rapidly destroy books. A desert environment is not entirely free of these pests but it does help.
c. In humid environments, fungal attack is also a serious issue. It can occur to some degree in drier environments but halts altogether in extremely dry conditions.
The classic example is the Dead Sea scrolls, some of which are as much as 2300 years old. Most people have heard of them; fewer people realise that in total there are over 900 documents found in 11 different caves. The degree of preservation varies. Some of the scrolls that were simply stacked on the bare earth have disintegrated to fragments and have taken decades to partially reconstruct. However many were stored in earthenware jars with loose fitting ceramic lids. This seems to have given them better protection against insects, and traces of moisture in the soil after (the rare) rains. Some of these scrolls could be simply opened and read, millennia after they were placed there.
This is not a unique case. As another example, the Oxyrhynchus Papyri were documents discarded in rubbish pits by a desert community. With no more protection than shifting desert sands, many are still legible 1400 years after they were simply thrown away.
A potential advantage of this approach is that it is very cheap. Desert land costs pennies an acre, and the only other thing you need is some pots. And no long term personnel tasking.
2. Give them to an institution which will preserve them
Many of the most notable examples of well-preserved ancient documents have been in the care of long-lived institutions that intentionally take care of them. Often these are religious institutions; some are academic; and there are a smaller number of examples by governments or long-lived family businesses or estates. A particularly famous example is the geniza of Ben Ezra Synagogue in Cairo. In Jewish custom, a geniza is a storeroom for revered or sacred documents. In the late nineteenth century this one was discovered to have over 200,000 documents, mainly in excellent preservation, dating back as much as 700 years. Some included hand-written, personally signed letters from famous mediaeval personages.
Of course it helps that Cairo is also arid; but there are equally excellent examples in the Vatican's libraries, and those of ancient universities such as Oxford and Cambridge. The key is that it is not required to try to solve the preservation of the documents once and for all time, because the self-perpetuating institution will monitor and maintain them.
This does, of course, raise the secondary question of what institutions can be relied upon to last 500 years. Sure, any schmuck can found a cult, but most of them don't outlast the founder! Usually, it will be better to donate them to an institution that has already shown it has the chops for the really long haul.
3. The opposite of secrecy: duplicate them extensively
The great majority of ancient documents that we can still read today do not exist because we have a copy that is millennia old; they are available because they were popular, revered or important, and accessible for copying. If enough copies are made, some will survive to the next generation of duplication. This interacts well with the previous point if the institution has a mission to disseminate documents as well as to preserve them -- such as the scriptoria of mediaeval monasteries.
4. Transcribe them to durable materials
It is hard to keep books for a really long time because paper, parchment and papyrus are easily destroyed. However books have been produced on much more durable materials. Nowadays a holographic copy can be laser etched into stainless steel. In Sumer, 5300 years ago they pressed them into clay tablets. If the document was important, they fired the clay; otherwise they just let it dry. The fired versions are close to indestructible.