Show all packages in the cache

apt-cache pkgnames

Show all packages in the cache starting with vim

apt-cache show vim

Show all packages in the cache mentioning vim

apt-cache search vim

Show the details of a certain package

apt-cache pkgnames vim

Show the dependencies of a package

apt-cache showpkg vim

Update the local cache from the upstream repos

apt-get update

Install a package

sudo apt-get install vim

Upgrade a package

sudo apt-get install vim --only-upgrade

Install a package version

sudo apt-get install vim=2.3.5-3ubuntu1

Uninstall a package

apt-get remove vim

Remove config files for a package

apt-get purge vim

Flush the local cache

apt-get clean

Download a package

apt-get download vim