With the development of the virtualization of 5G core (5GC) network, the network architecture is more complex. Once faults occur, the fault root cause location (RCL) is difficult. Traditional operation and maintenance (O&M) cannot satisfy the requirements of RCL based on manual experience. This paper proposes the k-nearest neighbor and Bagging (kNN-Bagging) scheme for locating the root cause of 5GC network faults. It first concludes the fault root causes from the historical fault orders, and extracts the fault features based on the related alarm databases. Then, it conducts the pre-processing of the alarm data in order to better understand and the input data for machine learning (ML) algorithms. At last, k-nearest neighbor (kNN), Naive Bayes (NB), Support Vector Machines (SVM), kNN-NB-SVM (KNS), SVM-Bagging and kNN-Bagging algorithms are adopted to establish the fault RCL models. Experimental results show that the average accuracy of fault RCL of kNN-Bagging algorithm is optimal value, which are 92.6% and 91.6% respectively in the offline and online environment of the real-world 5GC network. The proposed approach can effectively shorten the fault processing time and improve the O&M efficiency of the 5GC network.