Assalaamu alaykum. As we all know, hunting and killing animals without the intention of eating the meat is haraam. However, many Muslim countries are facing the issue of feral pigs devastating crops, attacking people, spreading contaminates, and so on. Knowing the dangers of the feral pig population, especially in Tunisia, what does Islam permit regarding containing the feral pigs and protecting the people. If you cannot kill an animal without having a use for it like selling its meat or giving it away, then what is one supposed to do to reduce the pig pestilence?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
It is permissible to kill pigs in Islam; some scholars even deemed it obligatory, and others deemed it recommended. The Maaliki scholar Ad-Dardeer wrote, "...unless the hunted animal is an animal (a pig, for instance) whose meat is unlawful for consumption; in this case it is lawful to hunt it with the intention of killing it, and not in vain (without purpose)..." [Ash-Sharh Al-Kabeer]
The Shaafiʻi scholar Ar-Ramli wrote, "When (he) was asked whether it is recommended to kill pigs or not, he answered, 'It is recommended.'"
Hence, it is prescribed to kill such pigs to which the questioner is referring, especially if their evils worsen, causing ruin to people’s wealth. However, the case should be referred to the concerned authorities responsible for addressing the environmental affairs in case killing such pigs is against the laws of the country of your residence.
Allaah knows best.
You can search for fatwa through many choices