Label each can or packet with a colour fast waterproof pen, noting contents and date of storage. Use in sequence, the oldest first. Store methodically and if a label falls off, you should still have a good idea of the contents. Use adhesive tape to seal the lids. Indefinitely if absolutely dry.
Complete rations are available with various menus.
Either freeze-dried or dehydrated. They are lighter and less space-consuming than canned foods. Although both need water for reconstitution they can in dire circumstances be eaten as dry munch. Multivitamin's tablets are a good investment. The body can store up to a month's supply of most vitamins, then health will suffer if they are not replaced.