  Given a finite dimensional Lie algebra $\mathfrak{g}$, let
$\Gamma_\circ(\mathfrak{g})$ be the set of irreducible $\mathfrak{g}$-modules
with non-vanishing cohomology. We prove that a $\mathfrak{g}$-module $V$
belongs to $\Gamma_\circ(\mathfrak{g})$ only if $V$ is contained in the
exterior algebra of the solvable radical $\mathfrak{s}$ of $\mathfrak{g}$,
showing in particular that $\Gamma_\circ(\mathfrak{g})$ is a finite set and we
deduce that $H^*(\mathfrak{g},V)$ is an $L$-module, where $L$ is a fixed
subgroup of the connected component of $\operatorname{Aut}(\mathfrak{g})$ which
contains a Levi factor.
  We describe $\Gamma_\circ$ in some basic examples, including the Borel
subalgebras, and we also determine $\Gamma_\circ(\mathfrak{s}_n)$ for an
extension $\mathfrak{s}_n$ of the 2-dimensional abelian Lie algebra by the
standard filiform Lie algebra $\mathfrak{f}_n$. To this end, we described the
cohomology of $\mathfrak{f}_n$.
  We introduce the \emph{total cohomology} of a Lie algebra $\mathfrak{g}$, as
$TH^*(\mathfrak{g})=\bigoplus_{V\in \Gamma_\circ(\mathfrak{g})}
H^*(\mathfrak{g},V)$ and we develop further the theory of linear deformations
in order to prove that the total cohomology of a solvable Lie algebra is the
cohomology of its nilpotent shadow. Actually we prove that $\mathfrak{s}$ lies,
in the variety of Lie algebras, in a linear subspace of dimension at least
$\dim (\mathfrak{s}/\mathfrak{n})^2$, $\mathfrak{n}$ being the nilradical of
$\mathfrak{s}$, that contains the nilshadow of $\mathfrak{s}$ and such that all
its points have the same total cohomology.
