Vacuum sealed spaghetti that is uncooked will last for 1 to 2 years when it's stored at room temperature.
Vacuum sealed cooked spaghetti will last for 2 years or longer when kept frozen.
However the cooked vacuum sealed spaghetti is at it's best quality for a few months after being frozen but basically when properly vacuum sealed the cooked spaghetti should last near indefinitely.
However the longer the vacuum sealed spaghetti stays in the freezer the less tasty it becomes although it's still safe to eat.
You can also vacuum seal spaghetti and meat sauce as well to keep it longer.
Even soups and stews, sauces and salsa and even Chili can be vacuum sealed and frozen to make it last longer.
Vacuum sealing the spaghetti and other foods and freezing them helps to extend the shelf life of the foods as the vacuum sealed bag prevents oxygen from getting into the foods and causing bacteria to grow and spoilage.
Although even after a long time the vacuum sealed food could eventually go bad but vacuum sealed food lasts a lot longer than non vacuum sealed foods do.