Use apt-file to find a package that provides a program
If you're looking for a program and need to find a package that provides it, AND your package manager is APT (e.g. you're running Debian or one of its many derivatives, like Ubuntu), you, Sir, got a couple of options.
One way is to search package contents online at debian.org, or you could use apt-file.
First, we install it and update its database:
sudo aptitude install apt-file sudo apt-file update
Now, let's find what package provides command mimencode (since I'm looking for a program, I'll prepend the search with "bin" since that's where programs typically live):
apt-file search bin/mimencode metamail: usr/bin/mimencode
So I'll need to install package "metamail" to get program "mimencode":
1 2 3
sudo aptitude install metamail which mimencode /usr/bin/mimencode