Let \(\mathcal {R}_\lambda = \mathbb {F}_q + s_1\mathbb {F}_q + s_2\mathbb {F}_q + \ldots + s_\lambda \mathbb {F}_q\) , where \(s_\rho ^2 = s_\rho\) and \(s_\rho s_\varphi = s_\varphi s_\rho = 0\) for \(\rho , \varphi = 1, 2, \ldots , \lambda\) with \(\rho \ne \varphi\) , and \(q = p^e\) , where p is an odd prime and e is a positive integer. In this article, we have shown that if \(q> 3\) , then any linear code \(\mathcal {C}\) over \(\mathbb {F}_q\) is equivalent to a Euclidean linear complementary dual (LCD) code, and if \(0 \le \ell \le e\) , then the code \(\mathcal {C}\) is equivalent to an \(\ell\) -Galois LCD code.