Question: what is the  capital city of libya which  Barbary pirates was also based primarily in 
Sentence (from "Barbary pirates"): The Barbary pirates, sometimes called Barbary corsairs or Ottoman corsairs, were pirates and privateers who operated from North Africa, based primarily in the ports of Salé, Rabat, Algiers, Tunis, and Tripoli.
Relevant evidence: Yes