Given a finite-dimensional Lie algebra g, let Gamma(o) (g) be the set of irreducible g-modules with non-vanishing cohomology. We prove that a g-module V belongs to Gamma(o) (g) only if V is contained in the exterior algebra of the solvable radical s of g, showing in particular that Gamma(o) (g) is a finite set and we deduce that H*(g, V) is an L-module, where L is a fixed subgroup of the connected component of Aut(g) which contains a Levi factor. We describe Gamma(o) in some basic examples, including the Borel subalgebras, and we also determine Gamma(o) (s(n)) for an extension s(n) of the 2-dimensional abelian Lie algebra by the standard filiform Lie algebra f(n). To this end, we described the cohomology of f(n). We introduce the total cohomology of a Lie algebra g, as TH*(g) = circle plus(V epsilon Gamma o (g)) H*(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 s lies, in the variety of Lie algebras, in a linear subspace of dimension at least dim(s/n)(2), n being the nilradical of s, that contains the nilshadow of s and such that all its points have the same total cohomology.