Lee Presley was stopped by staff taking £287 of groceries from Morrisons, at 1.45pm, on July 30.
The court heard he has 35 convictions for 94 offences, dating back to 1996, with "a large amount of matters of dishonesty, including vehicle taking and robbery" on his record.
Simon King, mitigating, said: "He was asked to take two trollies out for £20 each, to pay off a drug debt.
"He very candidly said to police: "I know it was stolen property, I was just doing a favour."
He said Presley, who was last in court for shoplifting in 1998, faced "lots of different issues", including drug misuse, which had affected his mental health.
"He has had no intervention from probation for six years," Mr King added.
Presley, 47, of Queen Street, admitted theft when he appeared at Mansfield Magistrates Court, on Wednesday.
He was given bail, on condition he doesn't go to Morrisons in Retford, to return to court for pre-sentence reports on August 6.
He is due to appear at Lincoln Magistrates for a seperate matter, on Tuesday, August 15.
For more of the latest cases from Mansfield Magistrates Court click here.