Let $X$ be a compact complex smooth manifold with holomorphically trivial canonical class. 



> 
> It is true that any (sufficiently small?) deformation of the complex structure of $X$ also has holomorphically trivial canonical class?
> 
> 
> 



Deformations of Calabi-Yau manifolds
The answer in general is no. Nakamura has constructed [here](http://projecteuclid.org/euclid.jdg/1214432677) (pp.90, 96-99, solvmanifolds of type III-(3b)) an example of a compact complex (non-Kähler) manifold $M$ with $TM$ holomorphically trivial (so in particular $K\_M$ is holomorphically trivial) which has arbitrarily small deformations $M\_t$ with negative Kodaira dimension.


On the other hand, if $M$ is compact Kähler with $K\_M$ holomorphically trivial, then its sufficiently small deformations $M\_t$ are Kähler (Kodaira-Spencer) and still have $K\_{M\_t}$ holomorphically trivial. Indeed, we have $c\_1(K\_{M\_t})=0$ in $H^2(M\_t,\mathbb{Z})$ (a topological condition), so by the Calabi-Yau theorem they admit Ricci-flat Kähler metrics $g\_t$. On the other hand $\dim H^0(M\_t,K\_{M\_t})=h^{n,0}(M\_t)$ is locally constant hence equal to $1$, so you have a nontrivial holomorphic section $\Omega\_t$ of $K\_{M\_t}$. A Bochner formula gives $\Delta\_{g\_t}|\Omega\_t|^2\_{g\_t}=|\nabla \Omega\_t|^2\_{g\_t},$ which can be integrated on $M\_t$ to see that $\Omega\_t$ is parallel with respect to $g\_t$, hence it must be nowhere vanishing. This gives you a holomorphic trivialization of $K\_{M\_t}$.


Prompted by Piotr Achinger's comment below, let me also note the following generalization. If $M$ is compact complex with Hodge-de Rham (aka Frölicher) spectral sequence degenerating at $E\_1$ (this is true for all compact Kähler manifolds), and with $K\_M$ holomorphically trivial, then its sufficiently small deformations $M\_t$ also have spectral sequence degenerating at $E\_1$ (again by Kodaira-Spencer), and $K\_{M\_t}$ holomorphically trivial. Indeed, it is well-known that the degeneration at $E\_1$ is equivalent to the equality
$$b\_k(M)=\sum\_{p+q=k}h^{p,q}(M),$$
for all $k$, so in particular the Hodge numbers $h^{p,q}(M\_t)$ are locally constant. As above, you get a nontrivial holomorphic section $\Omega\_t$ of $K\_{M\_t}$. Now we don't have Ricci-flat Kähler metrics anymore, but by Proposition 1.6 and 1.1 of [this paper](https://arxiv.org/abs/1401.4797), we can find Hermitian metrics $g\_t$ on $M\_t$ whose first Chern form (i.e. Chern-Ricci curvature) vanishes, and then the Bochner formula goes through essentially as before ($\nabla$ now being the Chern connection of $g\_t$), see Lemma 2.1 in that paper.


