Ubuntu, Debian
apt-get build-dep <package>
If you got error
E: You must put some 'source' URIs in your sources.list
You have to enable deb-src in /etc/apt/sources.list.
Uncomment the deb-src line of the URLs which is enabled in deb line.
deb http://jp.archive.ubuntu.com/ubuntu xenial main restricted deb-src http://jp.archive.ubuntu.com/ubuntu xenial main restricted ...
CentOS, RHEL
yum-builddep <package>