A Rapid City man received a seven-year federal prison sentence for distributing fentanyl and heroin, following a probe into a fatal overdose.