Using the replica method, we derive the thermodynamic relations for a
fluid in equilibrium with a quenched porous matrix. In particular, the
appropriate Gibbs-Duhem equation is obtained as well as the equivalen
ce between grand canonical and canonical ensembles. The exact compress
iblity and virial equations are derived. Whereas the compressibility e
quation remains a direct and practical way to obtain the adsorption is
otherm, the virial equation involves terms which do not relate easily
to the properties of the fluid/matrix system. This explains the incons
istency between previous theoretical predictions and computer simulati
on results.