We consider the problem of upscaling transient real gas flow through heterogeneous bounded reservoirs. One of the commonly used methods for deriving effective permeabilities is based on stochastic averaging of nonlinear flow equations. Such an approach, however, would require rather restrictive assumptions about pressure-dependent coefficients. Instead, we use Kirchhoff transformation to linearize the governing stochastic equations prior to their averaging. The linearized problem is similar to that used in stochastic analysis of groundwater flow. We discuss the effects of temporal localization of the nonlocal averaged Darcy's law, as well as boundary effects, on the upscaled gas permeability. Extension of the results obtained by means of small perturbation analysis to highly heterogeneous porous formations is also discussed.