Dean Melnyk, 20, and Andrew Brown, 23, were given minimum terms of 20 years for killing Kevin MacKay, 40, in Ecclefechan last August.
A court heard how they  took the law into their own hands hours after the funeral of their friend Jamie Abba.
Lord Armstrong told the pair they had been convicted of a "brutal attack".
By Willie JohnstonBBC Scotland
Ecclefechan was quiet this morning as, 80 miles away in Edinburgh, a judge passed sentence on Dean Melnyk and Andrew Brown.  Most people were inside sheltering from the heavy rain; making sure they avoided me and my camera back to film the scene of the crime for TV.
But in a village whose population is less than 1,000 two unnatural deaths in less than a fortnight is going to have an impact and there is no doubt that impact has been severe.
There is tension here.  Police Scotland have worked hard to prevent it bubbling over into further violence, and still are.
Ten months ago, there was understandable shock and grief at the loss of 18-year-old Jamie Abba, apparently after taking a dodgy ecstasy tablet.
But no-one foresaw the next tragic consequences as Dean Melnyk and Andrew Brown turned vigilante killers of the man pinpointed for supplying the fatal drug to their young friend.
Their attack on Kevin MacKay was frenzied, their brutality shocking.
One man who did venture out to speak to me today - albeit off-camera - said the murderers deserved 30 years and should never show face in Ecclefechan again.
The High Court in Edinburgh heard how Melnyk and Brown believed that Mr MacKay had supplied the pill that killed 18-year-old Mr Abba, who was known as Jabba.
So the two men travelled from Lockerbie to Ecclefechan in Dumfries and Galloway and repeatedly stabbed him in a frenzied revenge attack last August.
Judge Lord Armstrong sentenced the two men to life imprisonment.
Passing sentence, he told Melnyk and Brown that 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 which resulted in the death of Kevin MacKay.
"This incident did not happen on the spur of the moment.
"It was pre-meditated - you wrongly took justice into your own hands."
He said they had travelled to the south of Scotland village with bladed weapons to carry out the attack.
"The court has heard that your victim suffered 80 injuries which were inflicted on the vital organs of your victim," he said.
"The court has also heard evidence that without immediate medical attention, your victim could not have survived more than five to 10 minutes.
"This was an intensely violent attack. The only sentence for murder is life imprisonment."
Melnyk, of Lockerbie, and Brown, of Ecclefechan, were convicted of murder following proceedings at the High Court in Glasgow in April.
Speaking after the sentencing, Procurator Fiscal Jennifer Harrower said: "There is no doubt that Andrew Brown and Dean Melnyk went looking for their victim with the sole intention of doing him serious harm.
"Minutes after finding him Kevin MacKay lay dead, brutally murdered.
"Yet again knives used in anger have left a family devastated and the perpetrators facing life behind bars."
Sgt Steven Wilson, based in Annan, said the incident had had a "significant" impact on the town.
"We have worked very hard with the community since then and in the weeks and months since that time to reassure all aspects of the community, support the families of the people involved and, ultimately, keep people safe," he said.
"There have been tensions, that is a certainty.
"However, the community in Ecclefechan and the families involved have, throughout this entire dreadful process, conducted themselves in an entirely dignified way."
Local councillor Archie Dryburgh said he thought people in the village would now want to "get on with their lives".
"You have got to remember that Ecclefechan is a very close knit community," he said.
"Anything like the events that happened last August is going to shock a village.
"The village itself felt some anger, some sadness - it actually felt threatened at certain times - but I think overall now the village is coming to terms with what actually happened."
Two men who murdered a man they blamed for supplying an ecstasy tablet that killed their teenage friend have been jailed for life.