Mark Peckham was found guilty of murdering George Kirk during a botched drug robbery at a house in Dubbo, western NSW, in the early hours of August 16, 2023.
Peckham knocked on Mr Kirk's bedroom window late on August 15 looking for drugs, but left after being told there were none in the house.
Just after midnight, Peckham returned with another man, Daniel Fitton, and the pair burst into Mr Kirk's bedroom, accusing him of treating them "like gronks".
Fitton left the room after a brief scuffle, while Peckham quickly and repeatedly "jabbed" Mr Kirk with a blade, the dealer's girlfriend Tammy Antaw told the NSW Supreme Court.
While a housemate called emergency services, Peckham threw a towel to his bleeding victim and urged Ms Antaw to apply pressure to the wound.
Peckham said sorry as he fled the house.
Paramedics could not revive Mr Kirk, who died of a deep stab wound near the left armpit.
In the hours afterwards, Peckham told several people about the stabbing, the court was told.
He was overheard telling one person: "I got treated like a gronk, so I took him out."
Justice Nicholas Chen on Monday sentenced Peckham to a non-parole period of 17-and-a-half years' jail, with a maximum term of 24 years.
"The taking of Mr Kirk's life is a tragedy which has caused profound grief and sorrow to those close to him," Justice Chen told the court sitting in Orange.
The crime was aggravated by the fact that Peckham arrived "unannounced and uninvited" at Mr Kirk's house, while free on bail for an earlier assault, Justice Chen said.
Peckham had a long history of violent crimes, including a robbery while armed with a screwdriver, a nightclub bashing and a police pursuit.
The 39-year-old unsuccessfully argued at trial that he got involved in the fight with Mr Kirk to defend himself and that he did not inflict the fatal injury.
Fitton earlier pleaded guilty to hindering the murder investigation and was sentenced to a maximum of 15 months' jail.
Peckham will be eligible for parole in July 2043.