2. The sum of the cubes of all roots of the equation $\left|x^{2}-x+\frac{1}{2010}\right|=\frac{1}{2010}$ is equal to
2. $\frac{669}{335}$.

The original equation is equivalent to
$x^{2}-x=0$ or $\frac{-1}{1005}$.
Its roots are $x_{1}=1, x_{2}=0, x_{3}, x_{4}$ satisfying $x_{3}+x_{4}=1, x_{3} x_{4}=\frac{1}{1005}$.
Then $x_{3}^{3}+x_{4}^{3}$
$$
\begin{array}{l}
=\left(x_{3}+x_{4}\right)\left[\left(x_{3}+x_{4}\right)^{2}-3 x_{3} x_{4}\right] \\
=1 \times\left(1-\frac{3}{1005}\right)=1-\frac{1}{335}=\frac{334}{335} .
\end{array}
$$

Thus, $x_{1}^{3}+x_{2}^{3}+x_{3}^{3}+x_{4}^{3}=\frac{669}{335}$.