6. Given the equation
$$
2(a-b) x^{2}+(2 b-a b) x+(a b-2 a)=0
$$

has two equal real roots. Then $\frac{2}{b}-\frac{1}{a}=(\quad)$.
(A) 0
(B) $\frac{1}{2}$
(C) 1
(D) 2
6. B.

Since $\Delta=4 b^{2}-4 a b^{2}+a^{2} b^{2}-8(a-b)(a b-2 a)=0$, after rearrangement we get
$$
4 b^{2}+4 a b^{2}+a^{2} b^{2}-8 a^{2} b+16 a^{2}-16 a b=0 .
$$

Given that $a \neq 0, b \neq 0$. Therefore, we have
$$
\begin{array}{l}
\frac{4}{a^{2}}+\frac{4}{a}+1-\frac{8}{b}+\frac{16}{b^{2}}-\frac{16}{a b}=0 \\
\Rightarrow 4\left(\frac{2}{b}-\frac{1}{a}\right)^{2}-4\left(\frac{2}{b}-\frac{1}{a}\right)+1=0 \\
\Rightarrow\left[2\left(\frac{2}{b}-\frac{1}{a}\right)-1\right]^{2}=0 .
\end{array}
$$

Thus, $\frac{2}{b}-\frac{1}{a}=\frac{1}{2}$.