The command to kill dogs, and its abrogation. The prohibition of keeping dogs, except for hunting, farming, (herding) livestock and the like Sahih Muslim 1570 b

Arabic hadith text
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا أَبُو أُسَامَةَ، حَدَّثَنَا عُبَيْدُ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَأَمَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم بِقَتْلِ الْكِلاَبِفَأَرْسَلَ فِي أَقْطَارِ الْمَدِينَةِ أَنْ تُقْتَلَ
Translation
Ibn 'Umar (Allah be pleased with them) reported

Allah's Messenger (ﷺ) ordered to kill dogs, and he sent (men) to the corners of Medina that they should be killed.