Dean Melnyk, 20, and Andrew Brown, 23, were given life sentences for killing Kevin MacKay, 39, who died after being stabbed 80 times.
The High Court in Edinburgh heard how the duo took the law into their own hands hours after the funeral of their 19-year-old friend Jamie Abba.
The pair believed Mr MacKay had supplied the pill that killed Mr Abba, who was known as Jabba.
Melnyk and Brown travelled from Lockerbie to Ecclefechan, in Dumfries and Galloway, and repeatedly stabbed Mr MacKay in a frenzied attack last August.
Melnyk, of Lockerbie, and Brown, of Ecclefechan, returned to court yesterday after having been convicted of murder at the High Court in Glasgow in April.
Sentence had been deferred for the court to obtain reports about their characters.
Passing the automatic life sentence, Judge Lord Armstrong told them they would both have to serve a minimum of 20 years before becoming eligible for parole.
He added: "You have been convicted of carrying out a brutal attack. This incident did not happen on the spur of the moment. It was pre-meditated. You wrongly took justice into your own hands.
"You travelled from Lockerbie to Ecclefechan with long bladed weapons and inflicted a number of injuries on your victim.
"The court has heard your victim suffered 80 injuries, which were inflicted on the vital organs."
During the trial, Melynyk told jurors he was "drunk and angry" when he and Brown attacked Mr MacKay, known as Kesty, last August 22.
The court heard that at Mr Abba's wake earlier that month, Melnyk got angry and Brown, known as Buster, spoke to him. Melnyk told the jury: "Buster said, 'We'll give Kesty a kicking' to cheer me up."
He said the two got a lift to Ecclefechan and after going into another house in the village, Brown led him to where Mr MacKay was staying. He added: "We had a knife each. I saw Buster stabbing Kesty. Buster was shouting, 'You killed Jabba, Kesty.'
"Kesty grabbed my leg. Buster kicked him off and I began stabbing Kesty."
After the killing Melnyk went to a friend's house in Lockerbie and told him: "I think I've killed Kesty."
As the verdict of murder against Melnyk was delivered, Mr MacKay's family and friends applauded.
Melnyk had denied murder but admitted culpable homicide on the grounds of diminished responsibility. However, this claim was rejected by the jury.
Minutes after pleading guilty to murder, Brown shouted to Mr MacKay's daughter Chelsea in the public gallery: "I had never meant to murder Kesty."
Before yesterday's sentencing, Brown's advocate, Alice Taggart, told the court her client was full of remorse for his role in the murder.
Ms Taggart added: "He is appalled by his conduct and has attempted to apologise to Mr MacKay's family.
"He is horrified by the consequences of his conduct. He has ruined the lives of Mr MacKay's family and the lives of his own family."
Melnyk's advocate, Sarah Livingston said her client was suffering from Post Traumatic Stress Disorder at the time of the offence. She said her client had also expressed remorse for his part in the attack.