One small problem. The pirates live in cities they may control, but that are filled with ordinary Somalis. It’s not like this is a country we can attack if they don’t do something. Nobody is in charge to do anything.
The only solution is to take them out at sea or via hit squads on land. And we are unlikely to do either of those things.
We can attack the areas around the ports. I suspect a lot of pirates and few civilians are right next to the captured ships.