Is it always true that a principal $G$-bundle $E$ admits a connection (on the total space, not a local connection on the base manifold $M$)? I know that it must be true, since almost every construction starts off with ...fix a connection on $E$..., I just don't know how to show this rigorously. The only proof I can find is:

Let $U_i\subset M$ be an open subset of $M$. Then $E$ restricted to $U_i$ is trival and we can construct a connection, denoted $\omega_i$, in this case. Now, let $\big( U_\alpha \big)$ be an open covering of $M$, and let $\big(f_\alpha\big)$ be a partition of unity subordinate to the cover. Then we can define a connection $\omega = \sum_{\alpha} (f_\alpha \circ \pi) \omega_\alpha$, where $\pi: E\rightarrow M$ is the projection.

However, doesn't the right-hand side of this expression live on $M$? Does this give a connection on $E$?