Best to get all the rest of your gear first, then box it up, haul it down to the store, and find the smallest pack that'll fit it all (including N days' food).
Several gear decisions have substantial impact on the size pack you need. For example, if you use a closed-cell foam pad, it's likely to get strapped to the outside of your pack, not in it. But an inflatable will probably go inside. A down sleeping bag will compress smaller than a synthetic. Will you use a bladder for water or carry bottles? The former will require a sleeve and room inside the pack, the latter good side pockets. Will you use a water filter, chlorine tablets, or something in between? Very different space requirements. Some tents take no more room than a Nalgene bottle, others fill half a good-sized pack.
And on and on. Buy your pack last if at all possible.