Effective elastic properties of solids with cavities of various shapes are derived in two approximations: the approximation of non-interacting cavities and the approximation of the average stress field (Mori-Tanaka’s scheme); the latter appears to be appropriate when mutual positions of defects are random. We construct the elastic potential of a solid with cavities. Such an approach covers, in a unified way, cavities of various shapes and any mixture of them. No degeneracies (or a need in a special limiting procedure) arise when cavities shrink to cracks. It also provides a unified description of both isotropic and anisotropic effective properties and recovers results available in the literature for special cases. Elastic potentials dictate the choice of proper parameters of cavity density. These parameters depend on defect shapes. Even in the case of random orientations, the isotropic overall properties cannot be characterized in terms of porosity alone; for elliptical holes, for example, a second parameter - “eccentricity” - is needed.