Consider a Lagrangian density
$$\mathcal{L}(\phi, \nabla \phi) = \frac{1}{2} \, g^{\mu \nu} \, \partial_{\mu} \phi \; \partial_{\nu} \phi + V(\phi) \tag{1}$$
... Assume now that $\phi = (\phi_0 + \varepsilon)$ and that $\phi_0$ satisfies equation (2). Inserting into said equation (2) and linearising yields
$$\nabla^{\mu} \nabla_{\mu} \varepsilon - \varepsilon \cdot \frac{\partial^2 V}{\partial \phi^2} \, \bigg|_{\phi_0} = 0 \tag{3}$$
The corresponding Lagrangian density that yields this EOM in $\varepsilon$ is
$$\tilde{\mathcal{L}}(\varepsilon, \nabla \varepsilon) = \frac{1}{2} \, g^{\mu \nu} \, \partial_{\mu} \varepsilon \; \partial_{\nu} \varepsilon + \varepsilon^2 \cdot \frac{1}{2} \, \frac{\partial^2 V}{\partial \phi^2} \, \bigg|_{\phi_0} \tag{4} $$
My question now is, how to obtain the Lagrangian (4) directly from the Lagrangian (1).
... what happens to the term linear in $\varepsilon$?
You have to show that the linear term is a total derivative, and thus doesn't change the equation of motion for epsilon. Remember it is the minimization of the action that generates the equations of motion, and the action is fixed at the boundaries, so a boundary term like a total derivative doesn't change the equation of motion.
From your Eq. (1), we have$$L(\phi_0 + \epsilon) = \frac{1}{2}(\partial\phi_0)^2 + \partial \phi_0\cdot\partial\epsilon + \frac{1}{2}(\partial \epsilon)^2+V(\phi_0)+\epsilon\frac{\partial V}{\partial \phi_0} +\frac{1}{2}\frac{\partial^2 V}{\partial \phi_0^2}\epsilon^2+O(\epsilon^3)$$$$=A + B\cdot\partial \epsilon + C\epsilon + \tilde L\;,$$where $A$ is completely independent of epsilon, akin to a "constant" in classical mechanics, and clearly does not affect the epsilon equation of motions. And where $B^\mu = \partial^\mu\phi_0$, also independent of epsilon. And where $C=\frac{\partial V}{\partial \phi_0}$, also independent of epsilon. And where $\tilde L$ is your Eq. (4).
But, by the equation of motion for $\phi_0$, we have:$$C = \partial\cdot B\;.$$
So, indeed the linear term is a total derivative:$$L = A + \partial\cdot\left(\epsilon B\right) + \tilde L$$