The second-order Fourier coefficients ($v_2$) characterizing the azimuthal distribution of $\Upsilon$(1S) and $\Upsilon$(2S) mesons arising from PbPb collisions at $\sqrt{s_\mathrm{NN}} =$ 5.02 TeV are studied. The $\Upsilon$ mesons are reconstructed in their dimuon decay channel, as measured by the CMS detector. The data set corresponds to an integrated luminosity of 1.7 nb$^{-1}$. The scalar product method is used to extract the $v_2$ coefficients of the azimuthal distribution. Results are reported for the rapidity range $|y|$$\lt$ 2.4, with the transverse momentum 0 $\lt$$p_\mathrm{T}$$\lt$ 50 GeV/$c$, and in three centrality ranges of 10-30%, 30-50% and 50-90%. In contrast to the J/$\psi$ mesons, the measured $v_2$ values for the $\Upsilon$ mesons are found to be consistent with zero.