5. If the odd function $y=f(x)$ defined on $\mathbf{R}$ is symmetric about the line $x=1$, and when $0<x \leqslant 1$, $f(x)=\log _{3} x$, then the sum of all real roots of the equation $f(x)=-\frac{1}{3}+f(0)$ in the interval $(0,10)$ is . $\qquad$
5. 30 .

Given that the graph of the function $y=f(x)$ is symmetric about the line $x=1$, and $f(x)$ is an odd function, we have
$$
f(x+2)=f(-x)=-f(x) .
$$

Therefore, $f(x+4)=-f(x+2)=f(x)$, which means $f(x)$ is a periodic function with 4 as one of its periods.
Since $f(x)$ is an odd function defined on $\mathbf{R}$, we know $f(0)=0$.
Thus, the equation $f(x)=-\frac{1}{3}+f(0)$ simplifies to
$$
f(x)=-\frac{1}{3} \text {. }
$$

From the graph, we can see that $f(x)=-\frac{1}{3}$ has one real root in $(0,1)$ and one in $(1,2)$, and the sum of these two roots is 2; $f(x)=-\frac{1}{3}$ has one real root in $(4,5)$ and one in $(5,6)$, and the sum of these two roots is 10; $f(x)=-\frac{1}{3}$ has one real root in $(8,9)$ and one in $(9,10)$, and the sum of these two roots is 18.

Therefore, the original equation has six distinct real roots in the interval $(0,10)$, and their sum is 30.