  In the dynamic linear program (LP) problem, we are given an LP undergoing
updates and we need to maintain an approximately optimal solution. Recently,
significant attention (e.g., [Gupta et al. STOC'17; Arar et al. ICALP'18, Wajc
STOC'20]) has been devoted to the study of special cases of dynamic packing and
covering LPs, such as the dynamic fractional matching and set cover problems.
But until now, there is no non-trivial dynamic algorithm for general packing
and covering LPs.
  In this paper, we settle the complexity of dynamic packing and covering LPs,
up to a polylogarithmic factor in update time. More precisely, in the partially
dynamic setting (where updates can either only relax or only restrict the
feasible region), we give near-optimal deterministic $\epsilon$-approximation
algorithms with polylogarithmic amortized update time. Then, we show that both
partially dynamic updates and amortized update time are necessary; without any
of these conditions, the trivial algorithm that recomputes the solution from
scratch after every update is essentially the best possible, assuming SETH.
  To obtain our results, we initiate a systematic study of the multiplicative
weights update (MWU) method in the dynamic setting. As by-products of our
techniques, we also obtain the first online $(1+\epsilon)$-competitive
algorithms for both covering and packing LPs with polylogarithmic recourse, and
the first streaming algorithms for covering and packing LPs with linear space
and polylogarithmic passes.
