A steady convective flow of a viscous incompressible fluid is considered in a tall vertical cylindrical pipe due to internal heat sources of the form Q = A+Br, where A and B are constants and r is the radial coordinate. Models of thermal convection with non-uniform internal heat generation are used in many applications. Examples include absorption of incidental radiation or zeroth-order chemical reactions. The pipe is closed so that the total fluid flux through the cross-section of the pipe is zero. The corresponding system of Navier-Stokes equations under the Boussinesq approximation is solved analytically. Linear stability of the steady convective flow is analyzed using the method of normal modes. The corresponding eigenvalue problem for the system of ordinary differential equations is solved numerically using the collocation method based on the Chebyshev polynomials. In the present paper we restrict ourselves only to asymmetric perturbations for the first azimuthal mode, since experiments for the case of heat sources of constant density have shown that it is the most unstable mode. It is found that even for Prandtl numbers smaller than 0.8 there exist two separate branches of the marginal stability curve. One of the branches is associated with the hydrodynamical mechanism due to the presence of an inflection point in the base flow velocity profile, while the second one is related to the instability in the form of thermal waves that propagate downstream with sufficiently large phase speed. It is found that the Prandtl number and both negative and positive B values have a destabilizing influence on the flow.