Hadith 646B1

قَالَ مَالِك : الْأَمْرُ عِنْدَنَا الَّذِي لَا اخْتِلَافَ فِيهِ ، أَنَّهُ لَا يُكْرَهُ الْاعْتِكَافُ فِي كُلِّ مَسْجِدٍ يُجَمَّعُ فِيهِ ، وَلَا أُرَاهُ كُرِهَ الْاعْتِكَافُ فِي الْمَسَاجِدِ الَّتِي لَا يُجَمَّعُ فِيهَا ، إِلَّا كَرَاهِيَةَ أَنْ يَخْرُجَ الْمُعْتَكِفُ مِنْ مَسْجِدِهِ الَّذِي اعْتَكَفَ فِيهِ إِلَى الْجُمُعَةِ أَوْ يَدَعَهَا ، فَإِنْ كَانَ مَسْجِدًا لَا يُجَمَّعُ فِيهِ الْجُمُعَةُ وَلَا يَجِبُ عَلَى صَاحِبِهِ إِتْيَانُ الْجُمُعَةِ فِي مَسْجِدٍ سِوَاهُ ، فَإِنِّي لَا أَرَى بَأْسًا بِالْاعْتِكَافِ فِيهِ لِأَنَّ اللَّهَ تَبَارَكَ وَتَعَالَى قَالَ : وَأَنْتُمْ عَاكِفُونَ فِي الْمَسَاجِدِ سورة البقرة آية 187 فَعَمَّ اللَّهُ الْمَسَاجِدَ كُلَّهَا وَلَمْ يَخُصَّ شَيْئًا مِنْهَا
Imam Malik, may Allah have mercy on him, said: In our view, the ruling—about which there is no disagreement—is that i'tikaf is not disliked in a mosque where Jumu'ah is held, and in those mosques where Jumu'ah is not held, i'tikaf is disliked for the reason that one would have to leave for the Jumu'ah prayer or abandon Jumu'ah. Except if there is a person upon whom Jumu'ah is not obligatory and he performs i'tikaf in a mosque where Jumu'ah is not held, then there is no objection to it, because Allah, Glorified and Exalted is He, said «﴿وَأَنْتُمْ عَاكِفُونَ فِي الْمَسَاجِدِ﴾ [البقرة: 187]» and did not specify any particular mosque.
Hadith Reference موطا امام مالك رواية يحييٰ / كتاب الاعتكاف / 646B1
Hadith Takhrij «شركة الحروف نمبر: 641، فواد عبدالباقي نمبر: 19 - كِتَابُ الِاعْتِكَافِ-ح: 3»