Powder, primers both will last for a VERY long time. Decades. Even if not stored in the very best of conditions. That being said, you want to try to store both in as close to ideal as possible. As mentioned in post #16, temperature and humidity variations are killers.
One fairly cheap and reliable method to minimize both:
1) Buy some of the cheap all styrofoam coolers, enough to store all of your powder and primers in.
2) Find a place in your abode that is temperature stable. An example is a closet that is not on an exterior wall. A closet because your HVAC does not do a good job of changing the temperature there. Other places can be found. In my abode, there is wasted space under a set of stairs that is definitely temperature and humidity stable. We mostly keep wine and some canned goods there. Think root cellar.
3) Pack your components in the styrofoam. Be sure to mark the lid with an inventory. Use a fresh or freshened desiccant bag in each. You can do other things like use Argon or Nitrogen to help purge the O2 but it will be sort of in vain with the porosity of styrofoam. Seal the lid with packing or duct tape.
4) Store the coolers in the area but place them on "sleepers". Like a couple of 2x4's to help keep them from touching much of anything like the floor or wall.
Your brass and bullets will also oxidize if not protected.
If you are serious about burying shit, be sure you use argon or nitrogen in vacuum bags. You can place those bags in a plastic barrel or PVC that you have buried. You can even top them off with mineral oil. Weapons, lather with motor oil or 90 weight and vacuum bag.
In a hundred years, your progeny will still have usable components.