  We study linear cosmological perturbations in the most general teleparallel
gravity setting, where gravity is mediated by the torsion and nonmetricity of a
flat connection alongside the metric. For a general linear perturbation of this
geometry around a homogeneous and isotropic background geometry, we derive the
irreducible decomposition of the perturbation variables, as well as their
behavior under gauge transformations, i.e., infinitesimal diffeomorphisms
generated by a vector field. In addition, we also study these properties for
the most general set of matter variables and gravitational field equations. We
then make use of these result to construct gauge-invariant perturbation
variables, using a general approach based on gauge conditions. We further
calculate these quantities also in the metric and symmetric teleparallel
geometries, where nonmetricity or torsion is imposed to vanish. To illustrate
our results, we derive the energy-momentum-hypermomentum conservation equations
for both the cosmological background and the linear perturbations. As another
example, we study the propagation of tensor perturbations in the $f(G)$, $f(T)$
and $f(Q)$ class of theories.
