Gavin Riley, 28, attacked William Gibb in the 47-year-old's flat at Elizabeth Street in Ibrox on 1 February.
He then ordered another man, William McIntyre, to get a chainsaw to cut up the body.
But Mr McIntyre alerted a neighbour who contacted police.
Riley, who admitted murder, was given a mandatory life sentence and ordered to serve a minimum of 17 years in prison.
Jailing him, judge Lord Boyd told Riley: "Having listened to the account of this dreadful act it is clear you engaged in a prolonged and brutal assault on him."
The judge said that the injuries inflicted on the victim were "truly horrific".
He told Riley: "I note you claim to have no recollection of what you did because of the level of your intoxication. Clearly, you were under the influence of alcohol and drugs."
The judge pointed out that Riley had been assessed as posing "the maximum risk to the public".
The court previously heard that Riley and Mr Gibb were friends and they lived in the same building.
At about 16:00 on the day of the murder, Riley took Mr McIntyre to Mr Gibb's flat where they socialised for a number of hours.
Later, Mr Gibb said something to Riley, who motioned to hit him but did not.
A few minutes later Riley grabbed Mr Gibb from the sofa and repeatedly punched him on the face.
Mr Gibb pleaded: "What are you doing I'm your friend?".
Riley appeared to back off but then told Mr Gibb to punch him and threatened to hit him if he did not.
He then grabbed the victim, threw him to the floor again and hit him with an ashtray and another item, before leaving the flat.
Riley returned a few minutes later with a kitchen knife, which had a 10in blade.
He asked Mr Gibb if he needed help to get up and became more angry when the victim replied: "No, you've just done this to your pal."
The court heard Riley then repeatedly stabbed Mr Gibb in the buttocks, legs and back.
He again asked the victim if he wanted help to get up but Mr Gibb replied: "No, you've put me there."
This angered Riley further and he repeatedly stabbed Mr Gibb on the left side of his body and slashed the left side of the neck, killing him.
Riley tried to wrap the body in a rug then started cutting his arm and ordered Mr McIntyre to get a chain saw.
Mr McIntyre left and asked a neighbour to contact police.
He returned to the building to find Riley dragging Mr Gibb's body at the back of the close.
When police arrived Riley tried to flee but he was arrested and taken to Cathcart police station where officers found he was in possession of a bloodstained knife.
A man who stabbed his friend 40 times during a "truly horrific" attack in Glasgow has been jailed for at least 17 years for murder.