You will run into some issues with differential equations with singularities.
Consider the differential operator $x\frac{d}{dx} -t $ from the trivial rank $1$ vector bundle on $\mathbb R$ to itself, for some constant $t$. The adjoint map is $-xd/dx -1 - t$, which is another operator in the same class.
If $t$ is not a nonnegative integer, then this complex is locally exact. We have to check that the differential equation $xdy/dx - ty =f(x)$ has solutions for smooth $f$. We will check this for $t<0$, but I think it is also true when $t$ is not a nonnegative integer. A solution is:
$$y = \frac{ f(0) }{t} + x^t \int_{0}^x \left(f(z)-f(0)\right) z^{-1-t} dz $$
This gives a global solution also, so it is globally exact. Moreover, since any solution to the differential equation is a multiple of $x^{t}$, if $t$ is not a nonnegative integer, there are no nonzero solutions, so the regular cohomology is trivial.
If $t$ is a negative integer, then the dual complex will have nontrivial $H^0$ due to the nonzero solutions, otherwise, say for $-1<t<0$, we can easily show that the dual complex, with $t$ also in that range, will have nontrivial compactly supported $H^1$. Indeed, since there are no solutions to the homogeneous version of the differential equation, our solution of the inhomogeneous version is unique, and we can easily find a compactly supported $f(x)$ where the unique solution $y$ is not compactly supported.
On the other hand, suppose we have a smoothness condition - specifically, that the kernel of the first map is a locally constant sheaf. In other words, a local solution to the differential equations that define the first map can be extended uniquely along any path, with possible monodromy.
Given a differential equation, a common trick is to add enough extra functions to make the equation first order. We can just as easily do this with a complex of vector bundles with differential equation operators - add variables to each map in the reverse order. This process is a homotopy equivalence of complexes, as is its dual.
Take the locally constant kernel sheaf, view it as a vector bundle iwth flat connection, and tensor it with the de Rham complex. We will build a map from this complex to the original one. This is plausible because they are both injective resolutions of the same thing, but we need to check it can be done with vector bundle maps. This is trivial in degree $0$. If we have built maps for the first $n$ degrees, we compose the $n$th map with $d$ and get a first-order function on $\Omega^{n-1}$ that vanishes, locally, on the image of anything from $\Omega^{n-2}$. Such a function, by the linear algebra of differential forms at a single point, depends only on $d$ of the form on $\Omega_{n}$.
This bundle map is a quasi-isomorphism of sheaf complexes. If we can check that its dual is also a quasi-isomorphism, we win - duality in an arbitrary locally free complex can be reduced to duality for the de Rham complex. By using mapping cones, it is sufficient to check that if a first-order complex is locally exact, its dual is also locally exact.
Let $V_0 \to V_1 \to \dots V_n$ be a locally exact first-order complex. We will actually be able to find a homotopy to $0$. $d: V_0 \to V_1$ is a first-order differential equation with no local solutions. If it has no solutions,it must have a formal reason. Specifically, if $f_1,..f_k$ are local coordinates for $V_0$, then by taking linear combinations of the differential equations, their derivatives, and the commutation relations,we must be able to obtain $f_1,\dots,f_k$. Otherwise we could solve it along curves and extend consistently to the whole space.
But this linear combination just gives an operator $k: V_1 \to V_0$ such that $kd$ is the identity. Now we have a differential equation $k\oplus d$ on $V_1$, still linear, that has no solutions. Repeating the process, we eventually get a homotopy between the bundle and $0$. Applying this homotopy to the dual, it will be locally exact as well.
Best Answer
A connected $n$-manifold $M \neq \emptyset$ is compact iff $H^n (M;\mathbb{Z}) \neq 0$.
EDIT: my old reference to Bredon, Topology and Geometry, page 346 ff, does not completely settle the issue, as George pointed out. So let me give a proof here. For compact $M$, Corollary 7.14 of the cited book gives the answer.
If $M$ is not compact, then Corollary 7.12 shows that $H_n (M;\mathbb{Z})=0$. By Corollary 7.13, $H_{n-1}(M;\mathbb{Z})$ is torsionfree. That is not by itself enough to conclude that $H^n (M,\mathbb{Z})=0$, since for example it could potentially happen that $H_{n-1}(M;\mathbb{Z})=\mathbb{Q}$, leading to a horrendous Ext-term. But such pathologies do not happen.
By Poincare duality, $$H^n(M;\mathbb{Z}) \cong H_0^{lf}(M;\mathbb{Z}_w)$$ (locally finite homology twisted by the orientation character). Any class in $H_0^{lf}(M;\mathbb{Z}_w)$ is represented by a locally finite collection of points, each labelled with an element of the fibre of $\mathbb{Z}_w$.
In other words, for every class $x \in H_0^{lf}(M;\mathbb{Z}_w)$, there is an at most countable discrete space $S$, a proper map $f:S \to M$ and $y \in H_0^{lf} (S,f^{\ast} \mathbb{Z}_w)= H_0^{lf}(S,\mathbb{Z})$ such that $f_\ast (y)=x$.
To show that $x=0$, I show that each proper map $f: S \to M$ can be extended to a proper map $h: S \times [0,\infty) \to M$. This settles the claim as $H_0^{lf}(S \times [0,\infty))=0$.
For each point $s \in S$, there is an 'exit path', i.e. a proper map $q_s: [0, \infty) \to M$, $q(0)=f(s)$. I wish to choose $h:S \times [0,\infty) \to M$ as the disjoint union of all the $q_s$'s, but without further care, $h$ can fail to be proper. We have to arrange the exit paths in such a way that each compact region $K \subset M$ is only hit by finitely many $q_s$'s.
To overcome this problem, write $M= \bigcup_{n\geq 0} N_n$ as the ascending union of compact codimension $0$ submanifolds with boundary. After replacing $N_n$ with $M_n$, the union of $N_n$ with all relatively compact connected components of $M-N_n$, the following is true: $M= \bigcup_{n \geq 0} M_n$, $M-M_n$ has no relatively compact connected component. The construction of the exhaustion guarantees that if $f(s) \in M_n-M_{n-1}$, $q_s$ can be chosen to stay in $M-M_{n-1}$. Hence the required finiteness is guaranteed.