Question: what is the  capital city of libya which  Barbary pirates was also based primarily in 
Sentence (from "Barbary pirates"): The main purpose of their attacks was to capture Christian slaves for the Ottoman slave trade as well as the general Muslim slavery market in North Africa and the Middle East.
Relevant evidence: No