Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Tribulations will appear, killing will increase, and knowledge will be taken away."When Umar heard Abu Hurayrah say, "Knowledge will be taken away," Umar remarked, "It will not be torn out from the hearts of the scholars, rather the scholars themselves will pass away."

Azami 1239

Sahih

عن أبي هريرة

أن رسول الله ﷺ قال: تظهر الفتن، ويكثر الهرج، ويرفع العلم. فلما عمر سمع أبا هريرة يقول: يرفع العلم. قال عمر: أما إنه ليس ينزع من صدور العلماء، ولكن يذهب العلماء.

الأعظمي 1239صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Knowledge
Chapter
Warnings in matters of knowledge
Section
Raising of knowledge and appearance of ignorance and tribulations at the end of time
Numbering
Jami al-Kamil 1239 (2nd edition)
Azami 1239