In this work we study a wide range of online covering and packing problems with various objectives. We provide a unified approach, based on a clean primal-dual method, for the design and analysis of online algorithms for this large class of problems. In particular, our analysis uses weak duality rather than a tailor made (i.e., problem specific) potential function. We demonstrate our primal dual approach by showing a simple alternative view and analysis of many previously suggested algorithms. We also obtain several new results using this new approach. Examples consist of the ski rental problem, dynamic TCP acknowledgement, routing, load balancing, online versions of set-cover and graph connectivity problems and caching.