This paper deals with the probabilistic analysis of a class of compartmental models formulated via a system of linear differential equations with time‐dependent non‐homogeneous terms. For the sake of generality, we assume that initial conditions and rates between compartments are random variables with arbitrary distributions while the source terms defining the flows entering the compartments are stochastic processes. We then take extensive advantage of the so‐called random variable transformation (RVT) technique to determine the first probability distribution of the solution of such a randomized model under very general hypotheses. In the simplest but relevant case of time‐independent source terms, we also obtain the probability distribution of the equilibrium, which is a random vector. Furthermore, we first particularize the aforementioned results for different types of integrable source terms that permit obtaining an explicit solution of the compartmental model: random constants, a train of Dirac delta impulses with random intensities, and a Wiener process. Secondly, we show an alternative approach based on the Liouville–Gibbs equation, which is useful when dealing with source terms that do not admit a closed‐form primitive. All the previous theoretical results are first illustrated through several numerical examples and simulations where a wide range of different probability distributions are assumed for the model parameters. The paper concludes by applying a compartmental model that describes the dynamics of oral drug administration through multiple chronologically spaced doses using synthetic data generated according to pharmacological references.