I think, in that case, Napoleon could have have more lasting advantages by either conquering, or allying with, the Barbary states rather than invading Egypt. This assumption is based on Napoleon’s history and also on earlier, pre-Napoleonic French history.
According to Wikipedia, the
Barbary coast had been an important source of wheat for Napoleon’s army in Italy during 1796.
And Napoleon also considered Algeria important enough that he created a contingency plan in 1808 to conquer it, according to a 1969 book,
“Modern History of the Arab Countries” by Vladmir Borisovitch Lutsky.
A little before the 1805
Battle of Trafalgar, Napoleon had scored a victory over the Barbary state of Algiers by sending his brother Jérôme’s naval squadron to cow the Dey of Algiers into releasing European slaves. Glenn J. Lamar describes this event in his book, “Jérôme Bonaparte: The War Years, 1800 – 1815, pages 22 - 23:
Once Napoleon had demonstrated who was the “Top Dog” over the Barbary states, he could perhapshave the option to ally with them, instead of a conquest. The Barbary fleets could have been added to Napoleon’s naval power and have been turned loose on British merchant ships while being given bases and shelter in all of French-occupied Europe.
France had done something similar to this before with the
Barbary pirates. The Barbary pirates had been very successful in those earlier centuries. Why not again ?
By again making the Barbary pirates into
French corsairs, Napoleon could unleash an additional weapon again the British.
So I believe that the Barbary states could have provided Napoleon with their near-by-to France wheat for his armies as well as naval reinforcements for his fleet against British merchant shipping. (The British men-of-war could not have protected all the merchant ships.).
On the other hand, Napoleon was never able to make any effective use of far away Egypt. But, if he first had the Barbary states on his side, he would be in a better position to acquire Egypt later, perhaps as part of a deal between France and Russia to divide up the Ottoman Empire. Then it could be on to India….