This is a guide containing the most popular and useful ways of using the APT and DPKG commands, and it applies to both Ubuntu and Debian (and their derivatives). I mentioned where super user privileges are required, the ones without a mention can be executed as normal user.
dpkg is pretty slow in Debian-based systems, usually because of the many files which are stored in the /var/lib/dpkg/info folder. To speed up things, Luca Bruno created a project called tdpkg which uses an sqlite3 or tokyocabinet database for loading the dpkg .list files in the /var/lib/dpkg/info folder which makes dpkg a lot faster.
The author (Luca Bruno) says that:
Several months ago I created an article with 5 APT (Advanced Packaging Tool) tips for both Debian and Ubuntu available here. APT is the package manager in Debian and Debian-based distributions, like Ubuntu. Here's part two of that article, with 5 more tips and tricks for APT.