Some context on what you're prepping for matters here. If this is for a situation where you can prepare and cook food (i.e. your house), then you should be looking at wheat berries/rice/beans/sugar/salt stored in airtight 5gal buckets with oxygen absorbers as the foundation of your food prep (along with whatever other tools and additional foods you need to actually prepare your meals). If you need meals that require no prep (i.e. bug-out/secondary location/vehicle), I'd recommend just going with HDR rations and some firestarting tools + water. They're surprisingly tasty for a $5/day price point, although less palatable if you can't heat up the entrees first (can be done by simply putting the bag in boiling water).
In any case, the key to making food remain palatable long-term is multiple layers of airtight storage with oxygen absorbers (vacuum seal it in mylar along with an absorber, then put those mylar bags with another absorber in a 5gal bucket), and temperature/moisture control (~50F, low-but-not-zero humidity).