Is there a necessary and sufficient condition for the tangent bundle of a fiber bundle to be trivial? My question is very basic (I don't know too much of differential geometry):
given a fiber bundle, is there a necessary and sufficient condition for its tangent bundle to be trivial?
I have some ideas, but submitted to some conditions on the cohomology ring of the bundle.
(I apologize if it is trivial.)
 A: A huge amount of different geometries (e.g. semi-Riemannian, conformal, projective, CR, etc.) are examples of Cartan geometries. These are curved generalizations of Klein geometries $G \twoheadrightarrow G/P$, where we have a principal $P$-bundle of adapted frames $\mathcal{P} \to M$ and a Cartan connection form $\omega: T\mathcal{P} \to \mathfrak{g}$ generalizing the Maurer-Cartan form.
And just as the Maurer-Cartan form gives a parallelization of the canonical principal $P$-bundle in Klein geometry $TG \cong G \times \mathfrak{g}$, so does the Cartan connection give a parallelization of the adapted frame bundle in Cartan geometry $T\mathcal{P} \cong \mathcal{P} \times \mathfrak{g}$.
So in practice quite a lot of principal bundles of interest will have trivial tangent bundles.
A: As the comments indicate, the level of generality of the question is optimistic. Here's a special case: the product $M\times N$ of smooth manifolds.
Recall that a manifold $X$ is stably parallelizable if $TX\oplus \mathbb{R}$ is trivial. By a standard argument in obstruction theory, this is so as soon as $TX\oplus \mathbb{R}^n$ is trivial for some $n\geq 1$. 
I assume $M$ and $N$ connected, positive-dimensional but not necessarily compact. The product $M\times N$ is parallelizable iff $M$ and $N$ are stably parallelizable and one of them has vanishing Euler characteristic.
Euler characteristics $\chi$ are relevant because $\chi(M\times N)=\chi(M)\chi(N)$ and because $\chi$ is precisely the obstruction to having one nowhere-zero vector field. 
The "if" direction has a short, elementary proof that I'll leave to you, but you can also look it up in the extremely short paper of E. B. Staples, Proc. A.M.S. 18 no. 3 (1967).
Conversely, if $M\times N$ is parallelizable then, choosing a trivialisation of $T(M\times N)$, and a point $y\in N$, we get by restriction to $M\times y$ a trivialization of $TM\oplus T_y N$. Hence $M$ (and similarly $N$) is stably parallelizable.
Part of this goes over to smooth fibre bundles $E \to B$ with connected base $B$ and fibre $F$: if $TE$ is trivial then $0=\chi(E)=\chi(B)\chi(F)$, and $F$ is stably parallelizable. But the pullback of the Hopf fibration $S^5\to \mathbb{CP}^2$ to $\mathbb{CP}^2\times S^1$ is an example where the total space $S^1\times S^5$ is parallelizable but the base is not stably parallelizable (it has non-vanishing $p_1$).
A: I just wanted to elaborate on Benoît Kloeckner's answer, so if you like what I say, please upvote his answer.
By a frame, I mean a basis of the tangent space at a point on a smooth
manifold $M$. The space $F$ of all possible frames, called the frame
bundle, is a principal $GL(n)$-bundle over the manifold, $n$ is the
dimension of the manifold. A point in $F$ is given by $(x, e)$, where
$x \in M$, $e = (e_1, \dots, e_n)$, and $e_i \in T_xM$. Associated
with each point is the dual frame $\omega^1, \dots, \omega^n \in
T_x^*M$. Let $\pi: F \rightarrow M$, $\pi(x,e) = x$, denote the
natural projection.
There is a natural set of $n$ $1$-forms $\hat\omega^1, \dots,
\hat\omega^n$ on $F$, which are called either "tautological" or
"semi-basic" and act as follows: If $v \in T_{(x,e)}F$, then
$
\langle \hat\omega^i,v\rangle = \langle\omega^i,\pi_* v \rangle,
$
where $\omega^1, \dots, \omega^n \in T^*_xM$ form a dual basis to the basis
$e_1, \dots, e_n \in T_xM$. These forms have the universal property
that given any section $s: M \rightarrow F$, $s^*\bar\omega^i$ are
$1$-forms on $M$ dual to the moving frame given by the $e_i$.
You can check that any connection $\nabla$ on $T_*M$ determines a set
of global $1$-forms $\hat\omega^i_j$ on $F$, such given any section
$s = (s_1, \dots, s_n): M \rightarrow F$, $\nabla s_j =
s_is^*\hat\omega^i_j$. Therefore, a connection on $F$ gives a set of global
$1$-forms $\hat\omega^1, \dots, \hat\omega^n, \hat\omega^1_1, \dots, \hat\omega^n_n$
that trivialize $T^*F$. The dual vector fields
trivialize $T_*F$.
Since there always exists a connection on $T_*M $, this shows that $F$
has a parallelizable tangent bundle. The same argument can be extended
to any principal $G$-bundle of tangent frames. As observed by
Hoeckner, the case $G = O(n)$ corresponds to a Riemannian structure.
This, of course, does not answer the original question, but it is a
important case where the answer is yes. These global $1$-forms are
extremely useful in many contexts; the work of Robert Bryant
illustrates this.
A: This is far from being a complete answer, but there is a case when one construct a parallelizable bundle (meaning its total space has trivial tangent bundle) from a given (geometric) bundle. 
The context is that of $G$-structure, which are a formalization of the concept of geometric structures. A $G$-structure is a set of data including a fiber bundle on a smooth manifold, which shall be thought of as the bundle of admissible frames. For example, in the Riemannian case ($G=O(n)$) the bundle is that of orthonormal frames. If the group $G$ has a finite-order rigidity property, then one can construct a sequence of bundles, the total space of each one being the base space of the next one, so that after a finite number of steps one gets a bundle whose total space is parallelizable. This is a tool to prove that the group of automorphisms of the $G$-structure is a Lie group. As an example, if I remember well the total space of the bundle of orthonormal frames on a Riemannian manifold is parallelizable.
All details are available in Kobayashi's transformation groups in differential geometry. 
