In this work, we first prove a necessary and sufficient condition for a pairs of linear codes over finite rings to be linear complementary pairs (abbreviated to LCPs). In particular, a judging criterion of free LCP of codes over finite commutative rings is obtained. Using the criterion of free LCP of codes, we construct a maximum-distance-separable (MDS) LCP of codes over ring Z4\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$\mathbb {Z}_4$$\end{document}. Then, all the possible LCP of codes over chain rings are determined. We also generalize the criterions for constacyclic and quasi-cyclic LCP of codes over finite fields to constacyclic and quasi-cyclic LCP of codes over chain rings. Finally, we give a characterization of LCP of codes over principal ideal rings. Under suitable conditions, we also obtain the judging criterion for a pairs of cyclic codes over principal ideal rings Zk\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$\mathbb {Z}_{k}$$\end{document} to be LCP, and illustrate a MDS LCP of cyclic codes over the principal ideal ring Z15\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$\mathbb {Z}_{15}$$\end{document}.