We consider the general situation of a compact relativistic body with anisotropic pressures in the presence of the electromagnetic field. The equation of state for the matter distribution is linear and may be applied to strange stars with quark matter. Three classes of new exact solutions are found to the Einstein Maxwell system. This is achieved by specifying a particular form for one of the gravitational potentials and the electric field intensity. We can regain anisotropic and isotropic models from our general class of solutions. A physical analysis indicates that the charged solutions describe realistic compact spheres with anisotropic matter distribution. The equation of state is consistent with dark energy stars and charged quark matter distributions. The masses and central densities correspond to realistic stellar objects in the general case when anisotropy and charge are present.