With a decomposition scheme for the bath correlation function, the hierarchical equations of motion (HEOM) are extended to the zero-temperature sub-Ohmic and Ohmic spin-boson model. We investigate the linear absorption spectrum of the sub-Ohmic and Ohmic spin-boson model at zero temperature. By applying the extended HEOM, the equilibrium spin dynamics are obtained approximately. Then the linear response function is calculated according to the Kubo formula rewritten in Liouville space. To explore the essence of phase transition, we compute the linear absorption spectrum defined by the linear response function of a dipole moment. By analyzing the peak structure of the linear response spectrum, we get the dependence of linear absorption spectrum with Kondo parameter and different bath exponents. The spin relaxation dynamics are also calculated to explore the coherent-incoherent dynamic transition (CI) and delocalizedlocalized phase transition (DL). The corresponding phase diagram of DL and CI transition are also obtained. We pose a energy level picture to understand the different mechanism of DL phase transition between the deep sub-Ohmic and Ohmic spin-boson model.