mkdir ~/tmp

Put this in your .zshrc or .bashrc
alias dl='dpkg -l > ~/tmp/dl'
alias dlg="cat ~/tmp/dl | sed -e 's/ii \([a-zA-Z\-]*[[:space:]]*[0-9a-zA-Z\.:\-]*\).*/\1/' | grep -i"
alias al='apt-cache pkgnames > ~/tmp/al'
alias alg='cat ~/tmp/al | grep'

Ok, that's done. Let us try:
% dl
will cache a list of packages you have installed.
% dl python
will list all packages' name contains 'python' string.
% al
will cache a list of available packages.
% alg 'kde4'
will list all packages' name contains 'kde4' string.
I use these a lot. Hope this will help.