Solution (source code)

= Solution

For a coaxial Gaussian cylinder of radius $r$ and length $L$, symmetry makes the <electric field> radial and constant on the curved surface. <Gauss's law> gives
$$
E(2\pi rL)=\frac{\lambda L}{\varepsilon_0},
$$
so
$$
\boxed{\mathbf E(r)=\frac{\lambda}{2\pi\varepsilon_0r}\,\mathbf e_r}.
$$
Since $\mathbf E=-\nabla\phi$, a potential relative to an arbitrary reference radius $r_0$ is
$$
\boxed{
\phi(r)=-\frac{\lambda}{2\pi\varepsilon_0}
\log\frac r{r_0}}.
$$
An infinite line charge has no finite convention $\phi(\infty)=0$.