Dry foods like rice, oats, pasta, and flour can last for months to years. Dried beans and legumes have an indefinite storage life but may lose some nutritional properties over time. Nuts and seeds have varying storage times and should be kept in a cool, dry place to prevent rancidity. Canned and boxed foods generally have longer shelf lives but should be consumed before their expiration dates.