We calculate cross sections for diphoton production in (semi)exclusive $PbPb$ collisions, relevant for the LHC. The calculation is based on equivalent photon approximation in the impact parameter space. The cross sections for elementary $\gamma \gamma \to \gamma \gamma$ subprocess are calculated including two different mechanisms. We take into account box diagrams with leptons and quarks in the loops. In addition, we consider a vector-meson dominance (VDM-Regge) contribution with virtual intermediate hadronic (vector-like) excitations of the photons. We get much higher cross sections in $PbPb$ collisions than in earlier calculation from the literature. This opens a possibility to study the $\gamma \gamma \to \gamma \gamma$ (quasi)elastic scattering at the LHC. We present many interesting differential distributions which could be measured by the ALICE, CMS or ATLAS Collaborations at the LHC. We study whether a separation or identification of different components (boxes, VDM-Regge) is possible. We find that the cross section for elastic $\gamma \gamma$ scattering could be measured in the heavy-ion collisions for subprocess energies smaller than $W_{\gamma\gamma} \approx 15-20$ GeV.