I did research what I should stock up on. The companies that sell a years worth of emergency food I thought was a bit expensive. I did consider rice, as well as plain flour, cheese (does not spoil, protein), beef jerky (really nice, but max life 1-2 years), peanut butter (surprisingly nutritious, protein), but eventually choose oatmeal. Oatmeal you buy in the store has a 2 yr expiration date on it. Realistically though it is probably closer to 10 yrs as long as you keep moisture away. I bought my oatmeal from a company that ships in 50lb bags, and it cost about $1/lb (excellent). If you pack it into airtight white plastic bins, flush out the oxygen with nitrogen to prevent both oxidation and mold/fungus, and seal it tight it will probably last decades.
The only nutrition source that I could find that has a longer shelf life than oatmeal/rice is pure alcohol (ethanol). The purer it is the longer it will last. Beer (properly handled) can last for years, wine and whiskey for decades (maybe centuries), and pure ethanol will last until the container breaks or until used. However alcohol is not a practical main emergency source of nutrition.
I have thought it through. I live in rural Pennsylvania, and the area around here has plenty of rabbits (yes, rabbits). For just that reason I bought a slingshot. I considered getting one of the Theraband enhanced monster slingshots but decided Theraband degrades too quickly, and is just overkill for just trying to kill a rabbit. I ended getting a really nice slingshot and am most pleased. Nice thing about slingshots is that ammo (pebbles) is plentiful. Even better is that a slingshot is nearly silent and attracts little notice. I did take test it when sitting in a chair by our small (too small) garden, and yes, slingshots definitely kills rabbits. Padding the diet with rabbits will stretch my supplies by some.
I imagine that if the need comes, after a month eating oatmeal it will get tiring and bland, but it will beat starving. Hunger makes almost any food taste good.