  We find the bosonic sector of the gauged supergravities that are obtained
from 11-dimensional supergravity by Scherk-Schwarz dimensional reduction with
flux to any dimension D. We show that, if certain obstructions are absent, the
Scherk-Schwarz ansatz for a finite set of D-dimensional fields can be extended
to a full compactification of M-theory, including an infinite tower of
Kaluza-Klein fields. The internal space is obtained from a group manifold
(which may be non-compact) by a discrete identification. We discuss the
symmetry algebra and the symmetry breaking patterns and illustrate these with
particular examples. We discuss the action of U-duality on these theories in
terms of symmetries of the D-dimensional supergravity, and argue that in
general it will take geometric flux compactifications to M-theory on
non-geometric backgrounds, such as U-folds with U-duality transition functions.
