With the aim of gaining a better physical insight into linear regimes in gyrotrons, a new linear model was developed. This model is based on a spectral approach for solving the self-consistent system of equations describing the wave-particle interaction in the cavity of a gyrotron oscillator. Taking into account the wall-losses self-consistently and including the main system inhomogeneities in the cavity geometry and in the magnetic field, the model is appropriate to consider real system parameters. The main advantage of the spectral approach, compared with a time-dependent approach, is the possibility to describe all of the stable and unstable modes, respectively, with negative and positive growth rates. This permits to reveal the existence of a new set of eigenmodes, in addition to the usual eigenmodes issued from cold-cavity modes. The proposed model can be used for studying other instabilities such as, for instance, backward waves potentially excited in gyrotron beam tunnels.