  If $\mathbb{F}_{q}$ is a finite field, $C$ is a vector subspace of
$\mathbb{F}_{q}^{n}$ (linear code), and $G$ is a subgroup of the group of
linear automorphisms of $\mathbb{F}_{q}^{n}$, $C$ is said to be $G$-invariant
if $g(C)=C$ for all $g\in G$. A solution to the problem of computing all the
$G$-invariant linear codes $C$ of $\mathbb{F}_{q}^{n}$ is offered. This will be
referred as the invariance problem. When $n=|G|t$, we determine conditions for
the existence of an isomorphism of $\mathbb{F}_{q}[G]$-modules between
$\mathbb{F}_{q}^{n}$ and $\mathbb{F}_{q}[G]\times \cdots \times
\mathbb{F}_{q}[G]$ ($t$-times), that preserves the Hamming weight. This reduces
the invariance problem to the determination of the
$\mathbb{F}_{q}[G]$-submodules of $\mathbb{F}_{q}[G]\times \cdots \times
\mathbb{F}_{q}[G]$ ($t$-times). The concept of Gaussian binomial coefficient
for semisimple $\mathbb{F}_{q}[G]$-modules, which is useful for counting
$G$-invariant codes, is introduced. Finally, a systematic way to compute all
the $G$-invariant linear codes $C\subseteq \mathbb{F}_{q}^{n}$ is provided,
when $(|G|,q)=1$.
