  Atomic nuclei appearing in cosmic rays are typically classified as primary or
secondary. However, a better understanding of their origin and propagation
properties is still necessary. We analyse the flux of primary (He, C, O) and
secondary nuclei (Li, Be, B) detected with rigidity (momentum/charge) between 2
GV and 3 TV by the Alpha Magnetic Spectrometer (AMS) on the International Space
Station. We show that $q$-exponential distribution functions, as motivated by
generalized versions of statistical mechanics with temperature fluctuations,
provide excellent fits for the measured flux of all nuclei considered. Primary
and secondary fluxes reveal a universal dependence on kinetic energy per
nucleon for which the underlying energy distribution functions are solely
distinguished by their effective degrees of freedom. All given spectra are
characterized by a universal mean temperature parameter $\sim$ 200 MeV which
agrees with the Hagedorn temperature. Our analysis suggests that QCD scattering
processes together with nonequilibrium temperature fluctuations provide a
plausible explanation for the observed universality in cosmic ray energy
spectra. Our analysis suggests that QCD scattering processes together with
nonequilibrium temperature fluctuations imprint universally onto the measured
cosmic ray spectra, and produce a similar shape of energy spectra as high
energy collider experiments on the Earth.
