  It is known that $G$-functions solutions of a linear differential equation of
order 1 with coefficients in $\overline{\mathbb{Q}}(z)$, are algebraic (of a
very precise form). No general result is known when the order is 2. In this
paper, we determine the form of a $G$-function solution of an inhomogeneous
equation of order 1 with coefficients in $\overline{\mathbb{Q}}(z)$, as well as
that of a $G$-function $f$ of differential order 2 over
$\overline{\mathbb{Q}}(z)$, and such that $f$ and $f'$ are algebraically
dependent over $\mathbb{C}(z)$. Our results apply more generally to
Nilsson-Gevrey arithmetic series of order 0 that encompass $G$-functions.
