sudo apt-get install $(apt-cache depends | grep Depends | sed “s/.*ends:\ //” | tr ‘\n’ ‘ ‘)
Where is the name of the package you want to install the dependencies for. A very cool command indeed especially when you want to build something from src instead of having your package manager download it.
From here.