Brian Shanahan
Permanoob
Sort of... Temporarily. Britain had the world's most powerful navy and threatened them with violence if they interfered with their shipping. That cut down on the piracy against Brit interests ,but didn't stop slaving raids in the Mediterranean, Ireland and Iceland. The Algerines couldn't resist the temptation. When the Napoleonic wars were over the US ( who had been a tributary, but the Algerines kept raising their rates ) sent a task force to beat them in to submision. A couple years later the British and Dutch sent a task force under Lord Exmouth which bombarded the city into changing their evil ways. Then France conquered Algeria.
Those attacks came mainly in the 1600's and early 1700's in a time when England and later Britain had not yet fully realised the need for an island nation to have a military power. The Royal Navy up until the reatoration was either an ad hoc and temporary grouping of private ships or a corrupt institution where your title or how much you could pay determined how far you progressed. After the Navy was refromed in the late 1600s the threat to the British Isles disappeared, though the carrying trade in the Med. was still in some danger.